modern-idoc 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -17
- package/dist/index.cjs +216 -222
- package/dist/index.d.cts +95 -95
- package/dist/index.d.mts +95 -95
- package/dist/index.d.ts +95 -95
- package/dist/index.js +1 -1
- package/dist/index.mjs +212 -219
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
type None = 'none';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
interface GradientFillDeclaration {
|
|
4
|
+
type: 'gradient';
|
|
5
|
+
opacity?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface SolidFillDeclaration {
|
|
9
|
+
type: 'solid';
|
|
10
|
+
color: string;
|
|
11
|
+
opacity?: number;
|
|
6
12
|
}
|
|
7
|
-
type AudioProp = None | AudioSource | AudioDeclaration;
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 0 -0.5 0
|
|
16
|
+
* -0.5 -0.5
|
|
17
|
+
* 0 -0.5 0
|
|
18
|
+
*/
|
|
19
|
+
interface TextureFillSourceRect {
|
|
20
|
+
left?: number;
|
|
21
|
+
top?: number;
|
|
22
|
+
bottom?: number;
|
|
23
|
+
right?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 0 0.5 0
|
|
27
|
+
* 0.5 0.5
|
|
28
|
+
* 0 0.5 0
|
|
29
|
+
*/
|
|
30
|
+
interface TextureFillStretchRect {
|
|
31
|
+
left?: number;
|
|
32
|
+
top?: number;
|
|
33
|
+
bottom?: number;
|
|
34
|
+
right?: number;
|
|
35
|
+
}
|
|
36
|
+
interface TextureFillStretch {
|
|
37
|
+
rect?: TextureFillStretchRect;
|
|
38
|
+
}
|
|
39
|
+
interface TextureFillTile {
|
|
10
40
|
alignment?: string;
|
|
11
41
|
scaleX?: number;
|
|
12
42
|
scaleY?: number;
|
|
@@ -14,29 +44,38 @@ interface ImageFillTile {
|
|
|
14
44
|
translateY?: number;
|
|
15
45
|
flip?: string;
|
|
16
46
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: 'image';
|
|
23
|
-
image: ImageFillSource;
|
|
47
|
+
type TextureFillSourceURL = string;
|
|
48
|
+
interface TextureFillDeclaration {
|
|
49
|
+
type: 'texture';
|
|
50
|
+
src: TextureFillSourceURL;
|
|
51
|
+
srcRect?: TextureFillSourceRect;
|
|
24
52
|
dpi?: number;
|
|
25
53
|
rotateWithShape?: boolean;
|
|
26
|
-
|
|
54
|
+
stretch?: TextureFillStretch;
|
|
55
|
+
tile?: TextureFillTile;
|
|
56
|
+
opacity?: number;
|
|
27
57
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
58
|
+
|
|
59
|
+
type SingleFillDeclaration = TextureFillDeclaration | SolidFillDeclaration | GradientFillDeclaration;
|
|
60
|
+
type FillDeclaration = SingleFillDeclaration[];
|
|
61
|
+
type FillProperty = None | string | SingleFillDeclaration | FillDeclaration;
|
|
62
|
+
declare function normalizeFill(fill?: FillProperty): FillDeclaration | undefined;
|
|
63
|
+
|
|
64
|
+
type TextureBackgroundSourceURL = TextureFillSourceURL;
|
|
65
|
+
type TextureBackgroundDeclaration = TextureFillDeclaration;
|
|
66
|
+
interface AudioBackgroundDeclaration {
|
|
67
|
+
type: 'audio';
|
|
68
|
+
src: string;
|
|
31
69
|
}
|
|
32
|
-
type
|
|
33
|
-
type
|
|
70
|
+
type SingleBackgroundDeclaration = AudioBackgroundDeclaration | TextureBackgroundDeclaration;
|
|
71
|
+
type BackgroundDeclaration = SingleBackgroundDeclaration[];
|
|
72
|
+
type BackgroundProperty = None | TextureBackgroundSourceURL | SingleBackgroundDeclaration | BackgroundDeclaration;
|
|
34
73
|
|
|
35
74
|
type SVGPathData = string;
|
|
36
75
|
type FillRule = 'nonzero' | 'evenodd';
|
|
37
76
|
type StrokeLinecap = 'butt' | 'round' | 'square';
|
|
38
77
|
type StrokeLinejoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';
|
|
39
|
-
interface
|
|
78
|
+
interface GeometryPathStyle {
|
|
40
79
|
[key: string]: any;
|
|
41
80
|
opacity: number;
|
|
42
81
|
visibility: string;
|
|
@@ -56,38 +95,27 @@ interface Path2DStyle {
|
|
|
56
95
|
strokeDasharray: number[];
|
|
57
96
|
strokeDashoffset: number;
|
|
58
97
|
}
|
|
59
|
-
interface
|
|
98
|
+
interface GeometryPathDeclaration extends Partial<GeometryPathStyle> {
|
|
60
99
|
data: SVGPathData;
|
|
61
100
|
}
|
|
62
101
|
interface GeometryDeclaration {
|
|
63
102
|
name?: string;
|
|
64
|
-
|
|
103
|
+
svg?: string;
|
|
104
|
+
viewBox?: number[];
|
|
105
|
+
paths?: GeometryPathDeclaration[];
|
|
65
106
|
}
|
|
66
|
-
type
|
|
107
|
+
type GeometryProperty = None | SVGPathData | SVGPathData[] | GeometryPathDeclaration[] | GeometryDeclaration;
|
|
108
|
+
declare function normalizeGeometry(geometry?: GeometryProperty): GeometryDeclaration | undefined;
|
|
67
109
|
|
|
68
|
-
interface
|
|
110
|
+
interface MetaProperty {
|
|
69
111
|
[key: string]: any;
|
|
70
112
|
}
|
|
71
113
|
|
|
72
114
|
interface IDOCNode {
|
|
73
115
|
name?: string;
|
|
74
116
|
children?: IDOCNode[];
|
|
75
|
-
meta?:
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
type ImageSource = string;
|
|
79
|
-
interface ImageSourceRect {
|
|
80
|
-
left?: number;
|
|
81
|
-
top?: number;
|
|
82
|
-
bottom?: number;
|
|
83
|
-
right?: number;
|
|
84
|
-
}
|
|
85
|
-
interface ImageDeclaration {
|
|
86
|
-
src: ImageSource;
|
|
87
|
-
srcRect?: ImageSourceRect;
|
|
88
|
-
opacity?: number;
|
|
117
|
+
meta?: MetaProperty;
|
|
89
118
|
}
|
|
90
|
-
type ImageProp = None | ImageSource | ImageDeclaration;
|
|
91
119
|
|
|
92
120
|
interface OutlineDeclaration {
|
|
93
121
|
width?: number;
|
|
@@ -96,7 +124,8 @@ interface OutlineDeclaration {
|
|
|
96
124
|
color?: string;
|
|
97
125
|
opacity?: number;
|
|
98
126
|
}
|
|
99
|
-
type
|
|
127
|
+
type OutlineProperty = None | string | Partial<OutlineDeclaration>;
|
|
128
|
+
declare function normalizeOutline(outline?: OutlineProperty): OutlineDeclaration | undefined;
|
|
100
129
|
|
|
101
130
|
type BoxShadow = None | string;
|
|
102
131
|
interface ShadowDeclaration {
|
|
@@ -105,7 +134,7 @@ interface ShadowDeclaration {
|
|
|
105
134
|
offsetY?: number;
|
|
106
135
|
blur?: number;
|
|
107
136
|
}
|
|
108
|
-
type
|
|
137
|
+
type ShadowProperty = None | BoxShadow | ShadowDeclaration;
|
|
109
138
|
interface ShadowStyleDeclaration {
|
|
110
139
|
boxShadow: BoxShadow;
|
|
111
140
|
shadowColor?: string;
|
|
@@ -113,6 +142,8 @@ interface ShadowStyleDeclaration {
|
|
|
113
142
|
shadowOffsetY?: number;
|
|
114
143
|
shadowBlur?: number;
|
|
115
144
|
}
|
|
145
|
+
declare function getDefaultShadowStyle(): ShadowStyleDeclaration;
|
|
146
|
+
declare function normalizeShadow(shadow?: ShadowProperty): ShadowDeclaration | undefined;
|
|
116
147
|
|
|
117
148
|
type StyleUnit = `${number}%` | number;
|
|
118
149
|
type Display = 'flex' | 'contents';
|
|
@@ -193,6 +224,7 @@ interface LayoutStyleDeclaration {
|
|
|
193
224
|
paddingBottom?: StyleUnit;
|
|
194
225
|
padding?: StyleUnit;
|
|
195
226
|
}
|
|
227
|
+
declare function getDefaultLayoutStyle(): LayoutStyleDeclaration;
|
|
196
228
|
|
|
197
229
|
interface TransformStyleDeclaration {
|
|
198
230
|
rotate: number;
|
|
@@ -205,6 +237,7 @@ interface TransformStyleDeclaration {
|
|
|
205
237
|
transform: None | string;
|
|
206
238
|
transformOrigin: string;
|
|
207
239
|
}
|
|
240
|
+
declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
208
241
|
|
|
209
242
|
interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyleDeclaration, ShadowStyleDeclaration {
|
|
210
243
|
backgroundImage?: None | string;
|
|
@@ -222,6 +255,7 @@ interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyle
|
|
|
222
255
|
pointerEvents: PointerEvents;
|
|
223
256
|
maskImage: None | string;
|
|
224
257
|
}
|
|
258
|
+
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
225
259
|
|
|
226
260
|
interface HighlightDeclaration {
|
|
227
261
|
image: HighlightImage;
|
|
@@ -240,6 +274,7 @@ interface HighlightStyleDeclaration {
|
|
|
240
274
|
highlightSize: HighlightSize;
|
|
241
275
|
highlightThickness: HighlightThickness;
|
|
242
276
|
}
|
|
277
|
+
declare function getDefaultHighlightStyle(): HighlightStyleDeclaration;
|
|
243
278
|
|
|
244
279
|
interface ListStyleDeclaration {
|
|
245
280
|
type: ListStyleType;
|
|
@@ -256,6 +291,7 @@ interface ListStyleStyleDeclaration {
|
|
|
256
291
|
listStyleSize: ListStyleSize;
|
|
257
292
|
listStylePosition: ListStylePosition;
|
|
258
293
|
}
|
|
294
|
+
declare function getDefaultListStyleStyle(): ListStyleStyleDeclaration;
|
|
259
295
|
|
|
260
296
|
interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
261
297
|
color: string;
|
|
@@ -271,6 +307,7 @@ interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
|
271
307
|
textOrientation: TextOrientation;
|
|
272
308
|
textDecoration: TextDecoration;
|
|
273
309
|
}
|
|
310
|
+
declare function getDefaultTextInlineStyle(): TextInlineStyleDeclaration;
|
|
274
311
|
|
|
275
312
|
interface TextLineStyleDeclaration extends ListStyleStyleDeclaration {
|
|
276
313
|
writingMode: WritingMode;
|
|
@@ -279,6 +316,7 @@ interface TextLineStyleDeclaration extends ListStyleStyleDeclaration {
|
|
|
279
316
|
textIndent: number;
|
|
280
317
|
lineHeight: number;
|
|
281
318
|
}
|
|
319
|
+
declare function getDefaultTextLineStyle(): TextLineStyleDeclaration;
|
|
282
320
|
|
|
283
321
|
interface TextDrawStyleDeclaration {
|
|
284
322
|
textStrokeWidth: number;
|
|
@@ -286,10 +324,12 @@ interface TextDrawStyleDeclaration {
|
|
|
286
324
|
}
|
|
287
325
|
interface TextStyleDeclaration extends TextLineStyleDeclaration, TextInlineStyleDeclaration, TextDrawStyleDeclaration {
|
|
288
326
|
}
|
|
327
|
+
declare function getDefaultTextStyle(): TextStyleDeclaration;
|
|
289
328
|
|
|
290
329
|
interface StyleDeclaration extends TextStyleDeclaration, ElementStyleDeclaration {
|
|
291
330
|
}
|
|
292
|
-
type
|
|
331
|
+
type StyleProperty = Partial<StyleDeclaration>;
|
|
332
|
+
declare function getDefaultStyle(): StyleDeclaration;
|
|
293
333
|
|
|
294
334
|
interface FragmentContent extends Partial<StyleDeclaration> {
|
|
295
335
|
content: string;
|
|
@@ -306,40 +346,32 @@ interface TextDeclaration {
|
|
|
306
346
|
measureDom?: any;
|
|
307
347
|
fonts?: any;
|
|
308
348
|
}
|
|
309
|
-
type
|
|
349
|
+
type TextProperty = string | TextContent | (TextDeclaration & {
|
|
310
350
|
content: TextContent;
|
|
311
351
|
}) | TextDeclaration;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
interface VideoDeclaration {
|
|
315
|
-
src: VideoSource;
|
|
316
|
-
opacity?: number;
|
|
317
|
-
}
|
|
318
|
-
type VideoProp = None | VideoSource | VideoDeclaration;
|
|
352
|
+
declare function normalizeTextContent(content?: TextContent): TextContentDeclaration;
|
|
353
|
+
declare function normalizeText(text?: TextProperty): TextDeclaration | undefined;
|
|
319
354
|
|
|
320
355
|
interface IDOCElement extends IDOCNode {
|
|
321
|
-
style?:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
outline?: OutlineProp;
|
|
329
|
-
shadow?: ShadowProp;
|
|
356
|
+
style?: StyleProperty;
|
|
357
|
+
text?: TextProperty;
|
|
358
|
+
geometry?: GeometryProperty;
|
|
359
|
+
fill?: FillProperty;
|
|
360
|
+
outline?: OutlineProperty;
|
|
361
|
+
background?: BackgroundProperty;
|
|
362
|
+
shadow?: ShadowProperty;
|
|
330
363
|
children?: IDOCElement[];
|
|
331
364
|
}
|
|
332
365
|
interface IDOCElementDeclaration extends IDOCElement {
|
|
333
|
-
image?: ImageDeclaration;
|
|
334
|
-
video?: VideoDeclaration;
|
|
335
|
-
audio?: AudioDeclaration;
|
|
336
366
|
text?: TextDeclaration;
|
|
337
367
|
geometry?: GeometryDeclaration;
|
|
338
368
|
fill?: FillDeclaration;
|
|
339
369
|
outline?: OutlineDeclaration;
|
|
370
|
+
background?: BackgroundDeclaration;
|
|
340
371
|
shadow?: ShadowDeclaration;
|
|
341
372
|
children?: IDOCElementDeclaration[];
|
|
342
373
|
}
|
|
374
|
+
declare function normalizeElement(element: IDOCElement): IDOCElementDeclaration;
|
|
343
375
|
|
|
344
376
|
interface IDOCDocument extends IDOCElement {
|
|
345
377
|
fonts?: any;
|
|
@@ -347,40 +379,8 @@ interface IDOCDocument extends IDOCElement {
|
|
|
347
379
|
interface IDOCDocumentDeclaration extends IDOCElementDeclaration {
|
|
348
380
|
fonts?: any;
|
|
349
381
|
}
|
|
350
|
-
|
|
351
|
-
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
352
|
-
|
|
353
|
-
declare function getDefaultLayoutStyle(): LayoutStyleDeclaration;
|
|
354
|
-
|
|
355
|
-
declare function getDefaultShadowStyle(): ShadowStyleDeclaration;
|
|
356
|
-
|
|
357
|
-
declare function getDefaultStyle(): StyleDeclaration;
|
|
358
|
-
|
|
359
|
-
declare function getDefaultTextStyle(): TextStyleDeclaration;
|
|
360
|
-
|
|
361
|
-
declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
382
|
+
declare function normalizeDocument(doc: IDOCDocument): IDOCDocumentDeclaration;
|
|
362
383
|
|
|
363
384
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
364
|
-
declare function deepClearUndef<T>(obj: T): T;
|
|
365
|
-
|
|
366
|
-
declare function normalizeAudio(audio?: AudioProp): AudioDeclaration | undefined;
|
|
367
|
-
|
|
368
|
-
declare function normalizeElement(element: IDOCElement): IDOCElementDeclaration;
|
|
369
|
-
|
|
370
|
-
declare function normalizeFill(fill?: FillProp): FillDeclaration | undefined;
|
|
371
|
-
|
|
372
|
-
declare function normalizeGeometry(geometry?: GeometryProp): GeometryDeclaration | undefined;
|
|
373
|
-
|
|
374
|
-
declare function normalizeImage(image?: ImageProp): ImageDeclaration | undefined;
|
|
375
|
-
|
|
376
|
-
declare function normalizeOutline(outline?: OutlineProp): OutlineDeclaration | undefined;
|
|
377
|
-
|
|
378
|
-
declare function normalizeShadow(shadow?: ShadowProp): ShadowDeclaration | undefined;
|
|
379
|
-
|
|
380
|
-
declare function normalizeText(text?: TextProp): TextDeclaration | undefined;
|
|
381
|
-
|
|
382
|
-
declare function normalizeTextContent(content?: TextContent): TextContentDeclaration;
|
|
383
|
-
|
|
384
|
-
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
385
385
|
|
|
386
|
-
export { type Align, type
|
|
386
|
+
export { type Align, type BorderStyle, type BoxShadow, type BoxSizing, type Direction, type Display, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type None, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SingleFillDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type VerticalAlign, type Visibility, type WritingMode, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeDocument, normalizeElement, normalizeFill, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
type None = 'none';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
interface GradientFillDeclaration {
|
|
4
|
+
type: 'gradient';
|
|
5
|
+
opacity?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface SolidFillDeclaration {
|
|
9
|
+
type: 'solid';
|
|
10
|
+
color: string;
|
|
11
|
+
opacity?: number;
|
|
6
12
|
}
|
|
7
|
-
type AudioProp = None | AudioSource | AudioDeclaration;
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 0 -0.5 0
|
|
16
|
+
* -0.5 -0.5
|
|
17
|
+
* 0 -0.5 0
|
|
18
|
+
*/
|
|
19
|
+
interface TextureFillSourceRect {
|
|
20
|
+
left?: number;
|
|
21
|
+
top?: number;
|
|
22
|
+
bottom?: number;
|
|
23
|
+
right?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 0 0.5 0
|
|
27
|
+
* 0.5 0.5
|
|
28
|
+
* 0 0.5 0
|
|
29
|
+
*/
|
|
30
|
+
interface TextureFillStretchRect {
|
|
31
|
+
left?: number;
|
|
32
|
+
top?: number;
|
|
33
|
+
bottom?: number;
|
|
34
|
+
right?: number;
|
|
35
|
+
}
|
|
36
|
+
interface TextureFillStretch {
|
|
37
|
+
rect?: TextureFillStretchRect;
|
|
38
|
+
}
|
|
39
|
+
interface TextureFillTile {
|
|
10
40
|
alignment?: string;
|
|
11
41
|
scaleX?: number;
|
|
12
42
|
scaleY?: number;
|
|
@@ -14,29 +44,38 @@ interface ImageFillTile {
|
|
|
14
44
|
translateY?: number;
|
|
15
45
|
flip?: string;
|
|
16
46
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: 'image';
|
|
23
|
-
image: ImageFillSource;
|
|
47
|
+
type TextureFillSourceURL = string;
|
|
48
|
+
interface TextureFillDeclaration {
|
|
49
|
+
type: 'texture';
|
|
50
|
+
src: TextureFillSourceURL;
|
|
51
|
+
srcRect?: TextureFillSourceRect;
|
|
24
52
|
dpi?: number;
|
|
25
53
|
rotateWithShape?: boolean;
|
|
26
|
-
|
|
54
|
+
stretch?: TextureFillStretch;
|
|
55
|
+
tile?: TextureFillTile;
|
|
56
|
+
opacity?: number;
|
|
27
57
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
58
|
+
|
|
59
|
+
type SingleFillDeclaration = TextureFillDeclaration | SolidFillDeclaration | GradientFillDeclaration;
|
|
60
|
+
type FillDeclaration = SingleFillDeclaration[];
|
|
61
|
+
type FillProperty = None | string | SingleFillDeclaration | FillDeclaration;
|
|
62
|
+
declare function normalizeFill(fill?: FillProperty): FillDeclaration | undefined;
|
|
63
|
+
|
|
64
|
+
type TextureBackgroundSourceURL = TextureFillSourceURL;
|
|
65
|
+
type TextureBackgroundDeclaration = TextureFillDeclaration;
|
|
66
|
+
interface AudioBackgroundDeclaration {
|
|
67
|
+
type: 'audio';
|
|
68
|
+
src: string;
|
|
31
69
|
}
|
|
32
|
-
type
|
|
33
|
-
type
|
|
70
|
+
type SingleBackgroundDeclaration = AudioBackgroundDeclaration | TextureBackgroundDeclaration;
|
|
71
|
+
type BackgroundDeclaration = SingleBackgroundDeclaration[];
|
|
72
|
+
type BackgroundProperty = None | TextureBackgroundSourceURL | SingleBackgroundDeclaration | BackgroundDeclaration;
|
|
34
73
|
|
|
35
74
|
type SVGPathData = string;
|
|
36
75
|
type FillRule = 'nonzero' | 'evenodd';
|
|
37
76
|
type StrokeLinecap = 'butt' | 'round' | 'square';
|
|
38
77
|
type StrokeLinejoin = 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round';
|
|
39
|
-
interface
|
|
78
|
+
interface GeometryPathStyle {
|
|
40
79
|
[key: string]: any;
|
|
41
80
|
opacity: number;
|
|
42
81
|
visibility: string;
|
|
@@ -56,38 +95,27 @@ interface Path2DStyle {
|
|
|
56
95
|
strokeDasharray: number[];
|
|
57
96
|
strokeDashoffset: number;
|
|
58
97
|
}
|
|
59
|
-
interface
|
|
98
|
+
interface GeometryPathDeclaration extends Partial<GeometryPathStyle> {
|
|
60
99
|
data: SVGPathData;
|
|
61
100
|
}
|
|
62
101
|
interface GeometryDeclaration {
|
|
63
102
|
name?: string;
|
|
64
|
-
|
|
103
|
+
svg?: string;
|
|
104
|
+
viewBox?: number[];
|
|
105
|
+
paths?: GeometryPathDeclaration[];
|
|
65
106
|
}
|
|
66
|
-
type
|
|
107
|
+
type GeometryProperty = None | SVGPathData | SVGPathData[] | GeometryPathDeclaration[] | GeometryDeclaration;
|
|
108
|
+
declare function normalizeGeometry(geometry?: GeometryProperty): GeometryDeclaration | undefined;
|
|
67
109
|
|
|
68
|
-
interface
|
|
110
|
+
interface MetaProperty {
|
|
69
111
|
[key: string]: any;
|
|
70
112
|
}
|
|
71
113
|
|
|
72
114
|
interface IDOCNode {
|
|
73
115
|
name?: string;
|
|
74
116
|
children?: IDOCNode[];
|
|
75
|
-
meta?:
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
type ImageSource = string;
|
|
79
|
-
interface ImageSourceRect {
|
|
80
|
-
left?: number;
|
|
81
|
-
top?: number;
|
|
82
|
-
bottom?: number;
|
|
83
|
-
right?: number;
|
|
84
|
-
}
|
|
85
|
-
interface ImageDeclaration {
|
|
86
|
-
src: ImageSource;
|
|
87
|
-
srcRect?: ImageSourceRect;
|
|
88
|
-
opacity?: number;
|
|
117
|
+
meta?: MetaProperty;
|
|
89
118
|
}
|
|
90
|
-
type ImageProp = None | ImageSource | ImageDeclaration;
|
|
91
119
|
|
|
92
120
|
interface OutlineDeclaration {
|
|
93
121
|
width?: number;
|
|
@@ -96,7 +124,8 @@ interface OutlineDeclaration {
|
|
|
96
124
|
color?: string;
|
|
97
125
|
opacity?: number;
|
|
98
126
|
}
|
|
99
|
-
type
|
|
127
|
+
type OutlineProperty = None | string | Partial<OutlineDeclaration>;
|
|
128
|
+
declare function normalizeOutline(outline?: OutlineProperty): OutlineDeclaration | undefined;
|
|
100
129
|
|
|
101
130
|
type BoxShadow = None | string;
|
|
102
131
|
interface ShadowDeclaration {
|
|
@@ -105,7 +134,7 @@ interface ShadowDeclaration {
|
|
|
105
134
|
offsetY?: number;
|
|
106
135
|
blur?: number;
|
|
107
136
|
}
|
|
108
|
-
type
|
|
137
|
+
type ShadowProperty = None | BoxShadow | ShadowDeclaration;
|
|
109
138
|
interface ShadowStyleDeclaration {
|
|
110
139
|
boxShadow: BoxShadow;
|
|
111
140
|
shadowColor?: string;
|
|
@@ -113,6 +142,8 @@ interface ShadowStyleDeclaration {
|
|
|
113
142
|
shadowOffsetY?: number;
|
|
114
143
|
shadowBlur?: number;
|
|
115
144
|
}
|
|
145
|
+
declare function getDefaultShadowStyle(): ShadowStyleDeclaration;
|
|
146
|
+
declare function normalizeShadow(shadow?: ShadowProperty): ShadowDeclaration | undefined;
|
|
116
147
|
|
|
117
148
|
type StyleUnit = `${number}%` | number;
|
|
118
149
|
type Display = 'flex' | 'contents';
|
|
@@ -193,6 +224,7 @@ interface LayoutStyleDeclaration {
|
|
|
193
224
|
paddingBottom?: StyleUnit;
|
|
194
225
|
padding?: StyleUnit;
|
|
195
226
|
}
|
|
227
|
+
declare function getDefaultLayoutStyle(): LayoutStyleDeclaration;
|
|
196
228
|
|
|
197
229
|
interface TransformStyleDeclaration {
|
|
198
230
|
rotate: number;
|
|
@@ -205,6 +237,7 @@ interface TransformStyleDeclaration {
|
|
|
205
237
|
transform: None | string;
|
|
206
238
|
transformOrigin: string;
|
|
207
239
|
}
|
|
240
|
+
declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
208
241
|
|
|
209
242
|
interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyleDeclaration, ShadowStyleDeclaration {
|
|
210
243
|
backgroundImage?: None | string;
|
|
@@ -222,6 +255,7 @@ interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyle
|
|
|
222
255
|
pointerEvents: PointerEvents;
|
|
223
256
|
maskImage: None | string;
|
|
224
257
|
}
|
|
258
|
+
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
225
259
|
|
|
226
260
|
interface HighlightDeclaration {
|
|
227
261
|
image: HighlightImage;
|
|
@@ -240,6 +274,7 @@ interface HighlightStyleDeclaration {
|
|
|
240
274
|
highlightSize: HighlightSize;
|
|
241
275
|
highlightThickness: HighlightThickness;
|
|
242
276
|
}
|
|
277
|
+
declare function getDefaultHighlightStyle(): HighlightStyleDeclaration;
|
|
243
278
|
|
|
244
279
|
interface ListStyleDeclaration {
|
|
245
280
|
type: ListStyleType;
|
|
@@ -256,6 +291,7 @@ interface ListStyleStyleDeclaration {
|
|
|
256
291
|
listStyleSize: ListStyleSize;
|
|
257
292
|
listStylePosition: ListStylePosition;
|
|
258
293
|
}
|
|
294
|
+
declare function getDefaultListStyleStyle(): ListStyleStyleDeclaration;
|
|
259
295
|
|
|
260
296
|
interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
261
297
|
color: string;
|
|
@@ -271,6 +307,7 @@ interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
|
271
307
|
textOrientation: TextOrientation;
|
|
272
308
|
textDecoration: TextDecoration;
|
|
273
309
|
}
|
|
310
|
+
declare function getDefaultTextInlineStyle(): TextInlineStyleDeclaration;
|
|
274
311
|
|
|
275
312
|
interface TextLineStyleDeclaration extends ListStyleStyleDeclaration {
|
|
276
313
|
writingMode: WritingMode;
|
|
@@ -279,6 +316,7 @@ interface TextLineStyleDeclaration extends ListStyleStyleDeclaration {
|
|
|
279
316
|
textIndent: number;
|
|
280
317
|
lineHeight: number;
|
|
281
318
|
}
|
|
319
|
+
declare function getDefaultTextLineStyle(): TextLineStyleDeclaration;
|
|
282
320
|
|
|
283
321
|
interface TextDrawStyleDeclaration {
|
|
284
322
|
textStrokeWidth: number;
|
|
@@ -286,10 +324,12 @@ interface TextDrawStyleDeclaration {
|
|
|
286
324
|
}
|
|
287
325
|
interface TextStyleDeclaration extends TextLineStyleDeclaration, TextInlineStyleDeclaration, TextDrawStyleDeclaration {
|
|
288
326
|
}
|
|
327
|
+
declare function getDefaultTextStyle(): TextStyleDeclaration;
|
|
289
328
|
|
|
290
329
|
interface StyleDeclaration extends TextStyleDeclaration, ElementStyleDeclaration {
|
|
291
330
|
}
|
|
292
|
-
type
|
|
331
|
+
type StyleProperty = Partial<StyleDeclaration>;
|
|
332
|
+
declare function getDefaultStyle(): StyleDeclaration;
|
|
293
333
|
|
|
294
334
|
interface FragmentContent extends Partial<StyleDeclaration> {
|
|
295
335
|
content: string;
|
|
@@ -306,40 +346,32 @@ interface TextDeclaration {
|
|
|
306
346
|
measureDom?: any;
|
|
307
347
|
fonts?: any;
|
|
308
348
|
}
|
|
309
|
-
type
|
|
349
|
+
type TextProperty = string | TextContent | (TextDeclaration & {
|
|
310
350
|
content: TextContent;
|
|
311
351
|
}) | TextDeclaration;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
interface VideoDeclaration {
|
|
315
|
-
src: VideoSource;
|
|
316
|
-
opacity?: number;
|
|
317
|
-
}
|
|
318
|
-
type VideoProp = None | VideoSource | VideoDeclaration;
|
|
352
|
+
declare function normalizeTextContent(content?: TextContent): TextContentDeclaration;
|
|
353
|
+
declare function normalizeText(text?: TextProperty): TextDeclaration | undefined;
|
|
319
354
|
|
|
320
355
|
interface IDOCElement extends IDOCNode {
|
|
321
|
-
style?:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
outline?: OutlineProp;
|
|
329
|
-
shadow?: ShadowProp;
|
|
356
|
+
style?: StyleProperty;
|
|
357
|
+
text?: TextProperty;
|
|
358
|
+
geometry?: GeometryProperty;
|
|
359
|
+
fill?: FillProperty;
|
|
360
|
+
outline?: OutlineProperty;
|
|
361
|
+
background?: BackgroundProperty;
|
|
362
|
+
shadow?: ShadowProperty;
|
|
330
363
|
children?: IDOCElement[];
|
|
331
364
|
}
|
|
332
365
|
interface IDOCElementDeclaration extends IDOCElement {
|
|
333
|
-
image?: ImageDeclaration;
|
|
334
|
-
video?: VideoDeclaration;
|
|
335
|
-
audio?: AudioDeclaration;
|
|
336
366
|
text?: TextDeclaration;
|
|
337
367
|
geometry?: GeometryDeclaration;
|
|
338
368
|
fill?: FillDeclaration;
|
|
339
369
|
outline?: OutlineDeclaration;
|
|
370
|
+
background?: BackgroundDeclaration;
|
|
340
371
|
shadow?: ShadowDeclaration;
|
|
341
372
|
children?: IDOCElementDeclaration[];
|
|
342
373
|
}
|
|
374
|
+
declare function normalizeElement(element: IDOCElement): IDOCElementDeclaration;
|
|
343
375
|
|
|
344
376
|
interface IDOCDocument extends IDOCElement {
|
|
345
377
|
fonts?: any;
|
|
@@ -347,40 +379,8 @@ interface IDOCDocument extends IDOCElement {
|
|
|
347
379
|
interface IDOCDocumentDeclaration extends IDOCElementDeclaration {
|
|
348
380
|
fonts?: any;
|
|
349
381
|
}
|
|
350
|
-
|
|
351
|
-
declare function getDefaultElementStyle(): ElementStyleDeclaration;
|
|
352
|
-
|
|
353
|
-
declare function getDefaultLayoutStyle(): LayoutStyleDeclaration;
|
|
354
|
-
|
|
355
|
-
declare function getDefaultShadowStyle(): ShadowStyleDeclaration;
|
|
356
|
-
|
|
357
|
-
declare function getDefaultStyle(): StyleDeclaration;
|
|
358
|
-
|
|
359
|
-
declare function getDefaultTextStyle(): TextStyleDeclaration;
|
|
360
|
-
|
|
361
|
-
declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
382
|
+
declare function normalizeDocument(doc: IDOCDocument): IDOCDocumentDeclaration;
|
|
362
383
|
|
|
363
384
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
364
|
-
declare function deepClearUndef<T>(obj: T): T;
|
|
365
|
-
|
|
366
|
-
declare function normalizeAudio(audio?: AudioProp): AudioDeclaration | undefined;
|
|
367
|
-
|
|
368
|
-
declare function normalizeElement(element: IDOCElement): IDOCElementDeclaration;
|
|
369
|
-
|
|
370
|
-
declare function normalizeFill(fill?: FillProp): FillDeclaration | undefined;
|
|
371
|
-
|
|
372
|
-
declare function normalizeGeometry(geometry?: GeometryProp): GeometryDeclaration | undefined;
|
|
373
|
-
|
|
374
|
-
declare function normalizeImage(image?: ImageProp): ImageDeclaration | undefined;
|
|
375
|
-
|
|
376
|
-
declare function normalizeOutline(outline?: OutlineProp): OutlineDeclaration | undefined;
|
|
377
|
-
|
|
378
|
-
declare function normalizeShadow(shadow?: ShadowProp): ShadowDeclaration | undefined;
|
|
379
|
-
|
|
380
|
-
declare function normalizeText(text?: TextProp): TextDeclaration | undefined;
|
|
381
|
-
|
|
382
|
-
declare function normalizeTextContent(content?: TextContent): TextContentDeclaration;
|
|
383
|
-
|
|
384
|
-
declare function normalizeVideo(video?: VideoProp): VideoDeclaration | undefined;
|
|
385
385
|
|
|
386
|
-
export { type Align, type
|
|
386
|
+
export { type Align, type BorderStyle, type BoxShadow, type BoxSizing, type Direction, type Display, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type FragmentContent, type GeometryDeclaration, type GeometryPathDeclaration, type GeometryPathStyle, type GeometryProperty, type GradientFillDeclaration, type HighlightColormap, type HighlightDeclaration, type HighlightImage, type HighlightLine, type HighlightReferImage, type HighlightSize, type HighlightStyleDeclaration, type HighlightThickness, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type Justify, type LayoutStyleDeclaration, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type None, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, type SingleFillDeclaration, type SolidFillDeclaration, type StrokeLinecap, type StrokeLinejoin, type StyleDeclaration, type StyleProperty, type StyleUnit, type TextAlign, type TextContent, type TextContentDeclaration, type TextContentFlat, type TextDeclaration, type TextDecoration, type TextDrawStyleDeclaration, type TextInlineStyleDeclaration, type TextLineStyleDeclaration, type TextOrientation, type TextProperty, type TextStyleDeclaration, type TextTransform, type TextWrap, type TextureFillDeclaration, type TextureFillSourceRect, type TextureFillSourceURL, type TextureFillStretch, type TextureFillStretchRect, type TextureFillTile, type TransformStyleDeclaration, type VerticalAlign, type Visibility, type WritingMode, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeDocument, normalizeElement, normalizeFill, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent };
|