forked from callstack/linaria
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact.d.ts
More file actions
33 lines (26 loc) · 743 Bytes
/
react.d.ts
File metadata and controls
33 lines (26 loc) · 743 Bytes
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
// TypeScript Version: 2.9
import * as React from 'react';
type CSSProperties = {
[key: string]: string | number | CSSProperties;
};
type StyledComponent<T> = React.StatelessComponent<
T & { as?: React.ReactType }
>;
type StyledTag<T> = <Props = T>(
strings: TemplateStringsArray,
...exprs: Array<
string | number | CSSProperties | ((props: Props) => string | number)
>
) => StyledComponent<Props>;
type StyledJSXIntrinsics = {
readonly [P in keyof JSX.IntrinsicElements]: StyledTag<
JSX.IntrinsicElements[P]
>
};
export const styled: StyledJSXIntrinsics & {
<T>(component: React.ReactType<T>): StyledTag<T>;
readonly [key: string]: StyledTag<{
children?: React.ReactNode;
[key: string]: any;
}>;
};