? boolean
: [T] extends [DateConstructor | { type: DateConstructor }]
? Date
- : [T] extends [
- (DateConstructor | infer U)[] | { type: (DateConstructor | infer U)[] }
- ]
- ? Date | InferPropType<U>
+ : [T] extends [(infer U)[] | { type: (infer U)[] }]
+ ? U extends DateConstructor
+ ? Date | InferPropType<U>
+ : InferPropType<U>
: [T] extends [Prop<infer V, infer D>]
? unknown extends V
? D
date?: Date
l?: Date
ll?: Date | number
+ lll?: string | number
}
type GT = string & { __brand: unknown }
},
date: Date,
l: [Date],
- ll: [Date, Number]
+ ll: [Date, Number],
+ lll: [String, Number]
},
setup(props) {
// type assertion. See https://github.com/SamVerschueren/tsd
expectType<ExpectedProps['date']>(props.date)
expectType<ExpectedProps['l']>(props.l)
expectType<ExpectedProps['ll']>(props.ll)
+ expectType<ExpectedProps['lll']>(props.lll)
// @ts-expect-error props should be readonly
expectError((props.a = 1))