-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.d.ts
77 lines (62 loc) · 1.93 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 2.8
import { RegisteredCache, SerializedStyles } from '@emotion/utils'
import * as CSS from 'csstype'
export { RegisteredCache, SerializedStyles }
export type CSSProperties = CSS.PropertiesFallback<number | string>
export type CSSPropertiesWithMultiValues<Props = unknown> = {
[K in keyof CSSProperties]:
| CSSProperties[K]
| ReadonlyArray<Extract<CSSProperties[K], string>>
| ((props: Props) => number | string)
}
export type CSSPseudos<Props = unknown> = {
[K in CSS.Pseudos]?: CSSObject<Props>
}
export interface ArrayCSSInterpolation<Props = unknown>
extends ReadonlyArray<CSSInterpolation<Props>> {}
export type InterpolationPrimitive<Props = unknown> =
| null
| undefined
| boolean
| number
| string
| ComponentSelector
| Keyframes
| SerializedStyles
| CSSObject<Props>
export type CSSInterpolation<Props = unknown> =
| InterpolationPrimitive<Props>
| ArrayCSSInterpolation<Props>
export interface CSSOthersObject<Props = unknown> {
[propertiesName: string]:
| CSSInterpolation<Props>
| ((props: Props) => number | string)
}
export interface CSSObject<Props = unknown>
extends CSSPropertiesWithMultiValues<Props>,
CSSPseudos<Props>,
CSSOthersObject<Props> {}
export interface ComponentSelector {
__emotion_styles: any
}
export type Keyframes = {
name: string
styles: string
anim: number
toString: () => string
} & string
export interface ArrayInterpolation<Props>
extends Array<Interpolation<Props>> {}
export interface FunctionInterpolation<Props> {
(props: Props): Interpolation<Props>
}
export type Interpolation<Props> =
| InterpolationPrimitive<Props>
| ArrayInterpolation<Props>
| FunctionInterpolation<Props>
export function serializeStyles<Props>(
args: Array<TemplateStringsArray | Interpolation<Props>>,
registered?: RegisteredCache,
props?: Props
): SerializedStyles