h: boolean
bb: string
bbb: string
+ bbbb: string | undefined
+ bbbbb: string | undefined
cc?: string[] | undefined
dd: { n: 1 }
ee?: () => string
// annotation
default: (props: any) => (props.bb as string) || 'foo'
},
+ bbbb: {
+ type: String,
+ default: undefined
+ },
+ bbbbb: {
+ type: String,
+ default: () => undefined
+ },
// explicit type casting
cc: Array as PropType<string[]>,
// required + type casting
expectType<ExpectedProps['h']>(props.h)
expectType<ExpectedProps['bb']>(props.bb)
expectType<ExpectedProps['bbb']>(props.bbb)
+ expectType<ExpectedProps['bbbb']>(props.bbbb)
+ expectType<ExpectedProps['bbbbb']>(props.bbbbb)
expectType<ExpectedProps['cc']>(props.cc)
expectType<ExpectedProps['dd']>(props.dd)
expectType<ExpectedProps['ee']>(props.ee)