-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
60 lines (47 loc) · 1.33 KB
/
types.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
/*****************************************************************
* JSX types
*****************************************************************/
type JsxChildrenObject = {
trans: {
text: string;
options: any;
};
};
type JsxChildren =
| JsxElement
| JsxChildrenObject
| string
| number
| JsxFragment
| boolean
| null
| undefined;
interface JsxElement<
P = any,
T extends string | JSXElementConstructor<any> =
| string
| JSXElementConstructor<any>
> {
type: T;
props: P;
key: Key | null;
}
type JSXElementConstructor<P> = (props: P) => JsxElement<any, any> | null;
type JsxFragment = Iterable<JsxChildren>;
/*****************************************************************
* Utils types
*****************************************************************/
declare function variable(name: string): string;
declare function setSubject(name: string): void;
declare function addInternalStyles(...styles: string[]): void;
/*****************************************************************
* Translation types
*****************************************************************/
declare function trans(key: string): string;
declare function t(key: string): string;
declare function addTrans(TranslationGroup: any): void;
type TranslationGroup = {
[key: string]: {
[key: string]: string;
};
};