source: trip-planner-front/node_modules/svgo/lib/types.ts@ e29cc2e

Last change on this file since e29cc2e was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 3.1 KB
Line 
1export type XastDoctype = {
2 type: 'doctype';
3 name: string;
4 data: {
5 doctype: string;
6 };
7};
8
9export type XastInstruction = {
10 type: 'instruction';
11 name: string;
12 value: string;
13};
14
15export type XastComment = {
16 type: 'comment';
17 value: string;
18};
19
20export type XastCdata = {
21 type: 'cdata';
22 value: string;
23};
24
25export type XastText = {
26 type: 'text';
27 value: string;
28};
29
30export type XastElement = {
31 type: 'element';
32 name: string;
33 attributes: Record<string, string>;
34 children: Array<XastChild>;
35};
36
37export type XastChild =
38 | XastDoctype
39 | XastInstruction
40 | XastComment
41 | XastCdata
42 | XastText
43 | XastElement;
44
45export type XastRoot = {
46 type: 'root';
47 children: Array<XastChild>;
48};
49
50export type XastParent = XastRoot | XastElement;
51
52export type XastNode = XastRoot | XastChild;
53
54export type StringifyOptions = {
55 doctypeStart?: string;
56 doctypeEnd?: string;
57 procInstStart?: string;
58 procInstEnd?: string;
59 tagOpenStart?: string;
60 tagOpenEnd?: string;
61 tagCloseStart?: string;
62 tagCloseEnd?: string;
63 tagShortStart?: string;
64 tagShortEnd?: string;
65 attrStart?: string;
66 attrEnd?: string;
67 commentStart?: string;
68 commentEnd?: string;
69 cdataStart?: string;
70 cdataEnd?: string;
71 textStart?: string;
72 textEnd?: string;
73 indent?: number | string;
74 regEntities?: RegExp;
75 regValEntities?: RegExp;
76 encodeEntity?: (char: string) => string;
77 pretty?: boolean;
78 useShortTags?: boolean;
79 eol?: 'lf' | 'crlf';
80 finalNewline?: boolean;
81};
82
83type VisitorNode<Node> = {
84 enter?: (node: Node, parentNode: XastParent) => void | symbol;
85 exit?: (node: Node, parentNode: XastParent) => void;
86};
87
88type VisitorRoot = {
89 enter?: (node: XastRoot, parentNode: null) => void;
90 exit?: (node: XastRoot, parentNode: null) => void;
91};
92
93export type Visitor = {
94 doctype?: VisitorNode<XastDoctype>;
95 instruction?: VisitorNode<XastInstruction>;
96 comment?: VisitorNode<XastComment>;
97 cdata?: VisitorNode<XastCdata>;
98 text?: VisitorNode<XastText>;
99 element?: VisitorNode<XastElement>;
100 root?: VisitorRoot;
101};
102
103export type PluginInfo = {
104 path?: string;
105 multipassCount: number;
106};
107
108export type Plugin<Params> = (
109 root: XastRoot,
110 params: Params,
111 info: PluginInfo
112) => null | Visitor;
113
114export type Specificity = [number, number, number, number];
115
116export type StylesheetDeclaration = {
117 name: string;
118 value: string;
119 important: boolean;
120};
121
122export type StylesheetRule = {
123 dynamic: boolean;
124 selectors: string;
125 specificity: Specificity;
126 declarations: Array<StylesheetDeclaration>;
127};
128
129export type Stylesheet = {
130 rules: Array<StylesheetRule>;
131 parents: Map<XastElement, XastParent>;
132};
133
134type StaticStyle = {
135 type: 'static';
136 inherited: boolean;
137 value: string;
138};
139
140type DynamicStyle = {
141 type: 'dynamic';
142 inherited: boolean;
143};
144
145export type ComputedStyles = Record<string, StaticStyle | DynamicStyle>;
146
147export type PathDataCommand =
148 | 'M'
149 | 'm'
150 | 'Z'
151 | 'z'
152 | 'L'
153 | 'l'
154 | 'H'
155 | 'h'
156 | 'V'
157 | 'v'
158 | 'C'
159 | 'c'
160 | 'S'
161 | 's'
162 | 'Q'
163 | 'q'
164 | 'T'
165 | 't'
166 | 'A'
167 | 'a';
168
169export type PathDataItem = {
170 command: PathDataCommand;
171 args: Array<number>;
172};
Note: See TracBrowser for help on using the repository browser.