3
3
4
4
import * as React from 'react'
5
5
import { ComponentSelector , Interpolation } from '@emotion/serialize'
6
- import { PropsOf , DistributiveOmit , Theme } from '@emotion/react'
6
+ import { PropsOf , Theme } from '@emotion/react'
7
7
8
8
export {
9
9
ArrayInterpolation ,
@@ -15,17 +15,17 @@ export { ComponentSelector, Interpolation }
15
15
16
16
/** Same as StyledOptions but shouldForwardProp must be a type guard */
17
17
export interface FilteringStyledOptions <
18
- Props ,
19
- ForwardedProps extends keyof Props = keyof Props
18
+ Props = Record < string , any > ,
19
+ ForwardedProps extends keyof Props & string = keyof Props & string
20
20
> {
21
21
label ?: string
22
- shouldForwardProp ?( propName : PropertyKey ) : propName is ForwardedProps
22
+ shouldForwardProp ?: ( propName : string ) => propName is ForwardedProps
23
23
target ?: string
24
24
}
25
25
26
- export interface StyledOptions < Props > {
26
+ export interface StyledOptions < Props = Record < string , any > > {
27
27
label ?: string
28
- shouldForwardProp ?( propName : PropertyKey ) : boolean
28
+ shouldForwardProp ?: ( propName : string ) => boolean
29
29
target ?: string
30
30
}
31
31
@@ -118,7 +118,8 @@ export interface CreateStyledComponent<
118
118
export interface CreateStyled {
119
119
<
120
120
C extends React . ComponentClass < React . ComponentProps < C > > ,
121
- ForwardedProps extends keyof React . ComponentProps < C > = keyof React . ComponentProps < C >
121
+ ForwardedProps extends keyof React . ComponentProps < C > &
122
+ string = keyof React . ComponentProps < C > & string
122
123
> (
123
124
component : C ,
124
125
options : FilteringStyledOptions < React . ComponentProps < C > , ForwardedProps >
@@ -147,7 +148,8 @@ export interface CreateStyled {
147
148
148
149
<
149
150
C extends React . ComponentType < React . ComponentProps < C > > ,
150
- ForwardedProps extends keyof React . ComponentProps < C > = keyof React . ComponentProps < C >
151
+ ForwardedProps extends keyof React . ComponentProps < C > &
152
+ string = keyof React . ComponentProps < C > & string
151
153
> (
152
154
component : C ,
153
155
options : FilteringStyledOptions < React . ComponentProps < C > , ForwardedProps >
@@ -168,7 +170,8 @@ export interface CreateStyled {
168
170
169
171
<
170
172
Tag extends keyof JSX . IntrinsicElements ,
171
- ForwardedProps extends keyof JSX . IntrinsicElements [ Tag ] = keyof JSX . IntrinsicElements [ Tag ]
173
+ ForwardedProps extends keyof JSX . IntrinsicElements [ Tag ] &
174
+ string = keyof JSX . IntrinsicElements [ Tag ] & string
172
175
> (
173
176
tag : Tag ,
174
177
options : FilteringStyledOptions < JSX . IntrinsicElements [ Tag ] , ForwardedProps >
0 commit comments