File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 66 "types" : " ./index.d.ts" ,
77 "scripts" : {
88 "build" : " tsc src/index.ts --declaration --outDir ." ,
9- "test" : " jest --coverage"
9+ "test" : " npm run -s test:code && npm run -s test:typescript" ,
10+ "test:code" : " jest --coverage" ,
11+ "test:typescript" : " npx tsc --noEmit --declaration --noUnusedLocals test-typescript.ts"
1012 },
1113 "repository" : " github:gr2m/javascript-plugin-architecture-with-typescript-definitions" ,
1214 "keywords" : [
Original file line number Diff line number Diff line change 1+ // ************************************************************
2+ // THIS CODE IS NOT EXECUTED. IT IS JUST FOR TYPECHECKING
3+ // ************************************************************
4+
5+ import { Base } from "./src" ;
6+
7+ function isString ( what : string ) { }
8+
9+ const base = new Base ( { option : "value" } ) ;
10+ isString ( base . options . option ) ;
11+
12+ const BaseWithDefaults = Base . defaults ( { parentOption : "value" } ) ;
13+ const baseWithDefaults = new BaseWithDefaults ( { childOption : "value" } ) ;
14+
15+ isString ( baseWithDefaults . options . childOption ) ;
16+ isString ( baseWithDefaults . options . parentOption ) ;
You can’t perform that action at this time.
0 commit comments