-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.d.ts
114 lines (102 loc) Β· 2.92 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 3.4
import { EmotionCache } from '@emotion/cache'
import {
ArrayInterpolation,
ComponentSelector,
CSSInterpolation,
CSSObject,
FunctionInterpolation,
Interpolation,
Keyframes,
SerializedStyles
} from '@emotion/serialize'
import {
ClassAttributes,
Context,
Provider,
FC,
ReactElement,
ReactNode,
Ref,
createElement
} from 'react'
import { EmotionJSX } from './jsx-namespace'
export {
ArrayInterpolation,
ComponentSelector,
CSSObject,
EmotionCache,
FunctionInterpolation,
Interpolation,
Keyframes,
SerializedStyles
}
export * from './theming'
export * from './helper'
// tslint:disable-next-line: no-empty-interface
export interface Theme {}
export const ThemeContext: Context<object>
export const CacheProvider: Provider<EmotionCache>
export function withEmotionCache<Props, RefType = any>(
func: (props: Props, context: EmotionCache, ref: Ref<RefType>) => ReactNode
): FC<Props & ClassAttributes<RefType>>
export function css(
template: TemplateStringsArray,
...args: Array<CSSInterpolation>
): SerializedStyles
export function css(...args: Array<CSSInterpolation>): SerializedStyles
export interface GlobalProps {
styles: Interpolation<Theme>
}
/**
* @desc
* JSX generic are supported only after [email protected]
*/
export function Global(props: GlobalProps): ReactElement
export function keyframes(
template: TemplateStringsArray,
...args: Array<CSSInterpolation>
): Keyframes
export function keyframes(...args: Array<CSSInterpolation>): Keyframes
export interface ArrayClassNamesArg extends Array<ClassNamesArg> {}
export type ClassNamesArg =
| undefined
| null
| string
| boolean
| { [className: string]: boolean | null | undefined }
| ArrayClassNamesArg
export interface ClassNamesContent {
css(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string
css(...args: Array<CSSInterpolation>): string
cx(...args: Array<ClassNamesArg>): string
theme: Theme
}
export interface ClassNamesProps {
children(content: ClassNamesContent): ReactNode
}
/**
* @desc
* JSX generic are supported only after [email protected]
*/
export function ClassNames(props: ClassNamesProps): ReactElement
export const jsx: typeof createElement
export namespace jsx {
namespace JSX {
interface Element extends EmotionJSX.Element {}
interface ElementClass extends EmotionJSX.ElementClass {}
interface ElementAttributesProperty
extends EmotionJSX.ElementAttributesProperty {}
interface ElementChildrenAttribute
extends EmotionJSX.ElementChildrenAttribute {}
type LibraryManagedAttributes<C, P> = EmotionJSX.LibraryManagedAttributes<
C,
P
>
interface IntrinsicAttributes extends EmotionJSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T>
extends EmotionJSX.IntrinsicClassAttributes<T> {}
type IntrinsicElements = EmotionJSX.IntrinsicElements
}
}