@@ -13,23 +13,28 @@ type CSS = CSSProperties
13
13
14
14
type Component = Vue . Component | Vue . DefineComponent
15
15
16
+ type ThemeObject = { theme : { type : any ; required : true } }
17
+
16
18
type StyledHTMLElement = {
17
19
[ K in keyof IntrinsicElementAttributes ] : (
18
- str : TemplateStringsArray
20
+ str : TemplateStringsArray ,
21
+ ...placeholders : ( (
22
+ props : Vue . ExtractPropTypes < ThemeObject >
23
+ ) => string | { toString : ( ) => string } ) [ ]
19
24
) => Vue . DefineComponent < IntrinsicElementAttributes [ K ] >
20
25
}
21
26
22
27
type StyledFunctionHTMLElement = {
23
28
<
24
29
Props = { [ key : string ] : Vue . Prop < unknown > } ,
25
- K extends keyof IntrinsicElementAttributes
30
+ K extends keyof IntrinsicElementAttributes = any
26
31
> (
27
32
component : K ,
28
33
props ?: Props
29
34
) : (
30
35
str : TemplateStringsArray ,
31
36
...placeholders : ( (
32
- props : Vue . ExtractPropTypes < Props >
37
+ props : Vue . ExtractPropTypes < Props & ThemeObject >
33
38
) => string | { toString : ( ) => string } ) [ ]
34
39
) => Vue . DefineComponent <
35
40
Vue . ExtractPropTypes < Props > & IntrinsicElementAttributes [ K ]
@@ -38,7 +43,10 @@ type StyledFunctionHTMLElement = {
38
43
39
44
type StyledVueComponent = {
40
45
< Props , T extends Component > ( component : T ) : (
41
- str : TemplateStringsArray
46
+ str : TemplateStringsArray ,
47
+ ...placeholders : ( (
48
+ props : Vue . ExtractPropTypes < ThemeObject >
49
+ ) => string | { toString : ( ) => string } ) [ ]
42
50
) => Vue . DefineComponent < Props > & T
43
51
}
44
52
@@ -224,7 +232,7 @@ interface IntrinsicElementAttributes {
224
232
view : Vue . SVGAttributes
225
233
}
226
234
227
- export const ThemeProvider : Vue . DefineComponent < { theme : object } >
235
+ export const ThemeProvider : Vue . DefineComponent < ThemeObject >
228
236
229
237
export const css : ( input : TemplateStringsArray ) => string
230
238
0 commit comments