@@ -28,6 +28,7 @@ describe('with object props', () => {
28
28
ffff : ( a : number , b : string ) => { a : boolean }
29
29
validated ?: string
30
30
date : Date
31
+ unknown : unknown
31
32
}
32
33
33
34
type GT = string & { __brand : unknown }
@@ -100,6 +101,10 @@ describe('with object props', () => {
100
101
type : Date ,
101
102
required : true ,
102
103
} ,
104
+ unknown : {
105
+ type : Object as PropType < unknown > ,
106
+ default : null ,
107
+ } ,
103
108
} ,
104
109
setup ( props ) {
105
110
// type assertion. See https://github.com/SamVerschueren/tsd
@@ -121,6 +126,7 @@ describe('with object props', () => {
121
126
expectType < ExpectedProps [ 'ffff' ] > ( props . ffff )
122
127
expectType < ExpectedProps [ 'validated' ] > ( props . validated )
123
128
expectType < ExpectedProps [ 'date' ] > ( props . date )
129
+ expectType < typeof props . unknown > ( { } as ExpectedProps [ 'unknown' ] )
124
130
125
131
isNotAnyOrUndefined ( props . a )
126
132
isNotAnyOrUndefined ( props . b )
@@ -171,6 +177,7 @@ describe('with object props', () => {
171
177
expectType < ExpectedProps [ 'hhh' ] > ( props . hhh )
172
178
expectType < ExpectedProps [ 'ffff' ] > ( props . ffff )
173
179
expectType < ExpectedProps [ 'validated' ] > ( props . validated )
180
+ expectType < typeof props . unknown > ( { } as ExpectedProps [ 'unknown' ] )
174
181
175
182
// @ts -expect-error props should be readonly
176
183
expectError ( ( props . a = 1 ) )
0 commit comments