File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1313 " ssb"
1414 ],
1515 "scripts" : {
16- "prepublish" : " tsc"
16+ "prepublish" : " tsc" ,
17+ "test" : " tsc --noEmit test.ts"
1718 },
1819 "devDependencies" : {
20+ "tsd" :" ~0.15.1" ,
1921 "ts-node" : " ^9.1.1" ,
2022 "typescript" : " ~4.2.2"
2123 }
Original file line number Diff line number Diff line change 1+ import { expectType } from 'tsd' ;
2+ import { Content } from './readme' ;
3+
4+ const content : Content = null as any ;
5+ if ( content . type === 'post' ) {
6+ expectType < 'post' > ( content . type ) ;
7+ expectType < string > ( content . text ) ;
8+ } else if ( content . type === 'about' ) {
9+ expectType < string > ( content . about ) ;
10+ } else if ( content . type === 'contact' ) {
11+ expectType < string > ( content . contact ) ;
12+ } else if ( content . type === 'blog' ) {
13+ expectType < string > ( content . title ) ;
14+ expectType < string > ( content . summary ) ;
15+ expectType < string > ( content . blog ) ;
16+ } else if ( content . type === 'vote' ) {
17+ expectType < { value : number ; expression : string ; link : string } > ( content . vote ) ;
18+ }
You can’t perform that action at this time.
0 commit comments