-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
39 lines (34 loc) · 923 Bytes
/
global.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
export type HtmlString = string;
export interface HtmlElement {
tag?: string;
value?: string;
href?: string;
width?: number;
height?: number;
alt?: string;
classNames?: string;
src?: string;
}
export interface ParsedHtml<T> {
[key: string]: T | HtmlElement[];
}
export interface IElementProps {
content: HtmlElement;
children?: React.ReactNode | React.ReactNode[];
}
export interface JSXMapperType {
p?: React.FC<IElementProps>;
br?: React.FC<IElementProps>;
span?: React.FC<IElementProps>;
a?: React.FC<IElementProps>;
link?: React.FC<IElementProps>;
h1?: React.FC<IElementProps>;
h2?: React.FC<IElementProps>;
h3?: React.FC<IElementProps>;
h4?: React.FC<IElementProps>;
h5?: React.FC<IElementProps>;
h6?: React.FC<IElementProps>;
img?: React.FC<IElementProps>;
[key: string]: React.FC<IElementProps> | undefined;
}
export type JSXMapperElements = keyof JSXMapperType;