modern-idoc 0.3.2 → 0.3.3
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/dist/index.d.cts +69 -12
- package/dist/index.d.mts +69 -12
- package/dist/index.d.ts +69 -12
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,67 @@
|
|
|
1
1
|
type None = 'none';
|
|
2
|
+
declare interface RgbColor {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
declare interface HslColor {
|
|
8
|
+
h: number;
|
|
9
|
+
s: number;
|
|
10
|
+
l: number;
|
|
11
|
+
}
|
|
12
|
+
declare interface HsvColor {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
v: number;
|
|
16
|
+
}
|
|
17
|
+
declare interface HwbColor {
|
|
18
|
+
h: number;
|
|
19
|
+
w: number;
|
|
20
|
+
b: number;
|
|
21
|
+
}
|
|
22
|
+
interface XyzColor {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
z: number;
|
|
26
|
+
}
|
|
27
|
+
interface LabColor {
|
|
28
|
+
l: number;
|
|
29
|
+
a: number;
|
|
30
|
+
b: number;
|
|
31
|
+
}
|
|
32
|
+
interface LchColor {
|
|
33
|
+
l: number;
|
|
34
|
+
c: number;
|
|
35
|
+
h: number;
|
|
36
|
+
}
|
|
37
|
+
interface CmykColor {
|
|
38
|
+
c: number;
|
|
39
|
+
m: number;
|
|
40
|
+
y: number;
|
|
41
|
+
k: number;
|
|
42
|
+
}
|
|
43
|
+
declare type WithAlpha<O> = O & {
|
|
44
|
+
a: number;
|
|
45
|
+
};
|
|
46
|
+
declare type RgbaColor = WithAlpha<RgbColor>;
|
|
47
|
+
declare type HslaColor = WithAlpha<HslColor>;
|
|
48
|
+
declare type HsvaColor = WithAlpha<HsvColor>;
|
|
49
|
+
declare type HwbaColor = WithAlpha<HwbColor>;
|
|
50
|
+
declare type XyzaColor = WithAlpha<XyzColor>;
|
|
51
|
+
declare type LabaColor = LabColor & {
|
|
52
|
+
alpha: number;
|
|
53
|
+
};
|
|
54
|
+
declare type LchaColor = WithAlpha<LchColor>;
|
|
55
|
+
declare type CmykaColor = WithAlpha<CmykColor>;
|
|
56
|
+
declare type ObjectColor = RgbColor | RgbaColor | HslColor | HslaColor | HsvColor | HsvaColor | HwbColor | HwbaColor | XyzColor | XyzaColor | LabColor | LabaColor | LchColor | LchaColor | CmykColor | CmykaColor;
|
|
57
|
+
declare type AnyColor = string | ObjectColor;
|
|
58
|
+
type ColorValue = number | AnyColor;
|
|
2
59
|
|
|
3
60
|
interface GradientFillDeclaration {
|
|
4
61
|
}
|
|
5
62
|
|
|
6
63
|
interface SolidFillDeclaration {
|
|
7
|
-
color:
|
|
64
|
+
color: ColorValue;
|
|
8
65
|
}
|
|
9
66
|
|
|
10
67
|
/**
|
|
@@ -69,7 +126,7 @@ interface GeometryPathStyle {
|
|
|
69
126
|
[key: string]: any;
|
|
70
127
|
opacity: number;
|
|
71
128
|
visibility: string;
|
|
72
|
-
shadowColor:
|
|
129
|
+
shadowColor: ColorValue;
|
|
73
130
|
shadowOffsetX: number;
|
|
74
131
|
shadowOffsetY: number;
|
|
75
132
|
shadowBlur: number;
|
|
@@ -110,8 +167,8 @@ interface IDOCNode {
|
|
|
110
167
|
interface OutlineDeclaration {
|
|
111
168
|
width?: number;
|
|
112
169
|
style?: 'dashed' | 'solid' | string;
|
|
113
|
-
|
|
114
|
-
color?:
|
|
170
|
+
src?: string;
|
|
171
|
+
color?: ColorValue;
|
|
115
172
|
opacity?: number;
|
|
116
173
|
}
|
|
117
174
|
type OutlineProperty = None | string | Partial<OutlineDeclaration>;
|
|
@@ -119,7 +176,7 @@ declare function normalizeOutline(outline?: OutlineProperty): OutlineDeclaration
|
|
|
119
176
|
|
|
120
177
|
type BoxShadow = None | string;
|
|
121
178
|
interface ShadowDeclaration {
|
|
122
|
-
color:
|
|
179
|
+
color: ColorValue;
|
|
123
180
|
offsetX?: number;
|
|
124
181
|
offsetY?: number;
|
|
125
182
|
blur?: number;
|
|
@@ -127,7 +184,7 @@ interface ShadowDeclaration {
|
|
|
127
184
|
type ShadowProperty = None | BoxShadow | ShadowDeclaration;
|
|
128
185
|
interface ShadowStyleDeclaration {
|
|
129
186
|
boxShadow: BoxShadow;
|
|
130
|
-
shadowColor?:
|
|
187
|
+
shadowColor?: ColorValue;
|
|
131
188
|
shadowOffsetX?: number;
|
|
132
189
|
shadowOffsetY?: number;
|
|
133
190
|
shadowBlur?: number;
|
|
@@ -231,13 +288,13 @@ declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
|
231
288
|
|
|
232
289
|
interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyleDeclaration, ShadowStyleDeclaration {
|
|
233
290
|
backgroundImage?: None | string;
|
|
234
|
-
backgroundColor?: None |
|
|
291
|
+
backgroundColor?: None | ColorValue;
|
|
235
292
|
borderRadius: number;
|
|
236
|
-
borderColor?: None |
|
|
293
|
+
borderColor?: None | ColorValue;
|
|
237
294
|
borderStyle: BorderStyle;
|
|
238
295
|
outlineWidth: number;
|
|
239
296
|
outlineOffset: number;
|
|
240
|
-
outlineColor: None |
|
|
297
|
+
outlineColor: None | ColorValue;
|
|
241
298
|
outlineStyle: string;
|
|
242
299
|
visibility: Visibility;
|
|
243
300
|
filter: string;
|
|
@@ -284,7 +341,7 @@ interface ListStyleStyleDeclaration {
|
|
|
284
341
|
declare function getDefaultListStyleStyle(): ListStyleStyleDeclaration;
|
|
285
342
|
|
|
286
343
|
interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
287
|
-
color:
|
|
344
|
+
color: ColorValue;
|
|
288
345
|
verticalAlign: VerticalAlign;
|
|
289
346
|
letterSpacing: number;
|
|
290
347
|
wordSpacing: number;
|
|
@@ -310,7 +367,7 @@ declare function getDefaultTextLineStyle(): TextLineStyleDeclaration;
|
|
|
310
367
|
|
|
311
368
|
interface TextDrawStyleDeclaration {
|
|
312
369
|
textStrokeWidth: number;
|
|
313
|
-
textStrokeColor:
|
|
370
|
+
textStrokeColor: ColorValue;
|
|
314
371
|
}
|
|
315
372
|
interface TextStyleDeclaration extends TextLineStyleDeclaration, TextInlineStyleDeclaration, TextDrawStyleDeclaration {
|
|
316
373
|
}
|
|
@@ -373,4 +430,4 @@ declare function normalizeDocument(doc: IDOCDocument): IDOCDocumentDeclaration;
|
|
|
373
430
|
|
|
374
431
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
375
432
|
|
|
376
|
-
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 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 };
|
|
433
|
+
export { type Align, type AnyColor, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, 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 HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, 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, type XyzColor, type XyzaColor, 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,10 +1,67 @@
|
|
|
1
1
|
type None = 'none';
|
|
2
|
+
declare interface RgbColor {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
declare interface HslColor {
|
|
8
|
+
h: number;
|
|
9
|
+
s: number;
|
|
10
|
+
l: number;
|
|
11
|
+
}
|
|
12
|
+
declare interface HsvColor {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
v: number;
|
|
16
|
+
}
|
|
17
|
+
declare interface HwbColor {
|
|
18
|
+
h: number;
|
|
19
|
+
w: number;
|
|
20
|
+
b: number;
|
|
21
|
+
}
|
|
22
|
+
interface XyzColor {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
z: number;
|
|
26
|
+
}
|
|
27
|
+
interface LabColor {
|
|
28
|
+
l: number;
|
|
29
|
+
a: number;
|
|
30
|
+
b: number;
|
|
31
|
+
}
|
|
32
|
+
interface LchColor {
|
|
33
|
+
l: number;
|
|
34
|
+
c: number;
|
|
35
|
+
h: number;
|
|
36
|
+
}
|
|
37
|
+
interface CmykColor {
|
|
38
|
+
c: number;
|
|
39
|
+
m: number;
|
|
40
|
+
y: number;
|
|
41
|
+
k: number;
|
|
42
|
+
}
|
|
43
|
+
declare type WithAlpha<O> = O & {
|
|
44
|
+
a: number;
|
|
45
|
+
};
|
|
46
|
+
declare type RgbaColor = WithAlpha<RgbColor>;
|
|
47
|
+
declare type HslaColor = WithAlpha<HslColor>;
|
|
48
|
+
declare type HsvaColor = WithAlpha<HsvColor>;
|
|
49
|
+
declare type HwbaColor = WithAlpha<HwbColor>;
|
|
50
|
+
declare type XyzaColor = WithAlpha<XyzColor>;
|
|
51
|
+
declare type LabaColor = LabColor & {
|
|
52
|
+
alpha: number;
|
|
53
|
+
};
|
|
54
|
+
declare type LchaColor = WithAlpha<LchColor>;
|
|
55
|
+
declare type CmykaColor = WithAlpha<CmykColor>;
|
|
56
|
+
declare type ObjectColor = RgbColor | RgbaColor | HslColor | HslaColor | HsvColor | HsvaColor | HwbColor | HwbaColor | XyzColor | XyzaColor | LabColor | LabaColor | LchColor | LchaColor | CmykColor | CmykaColor;
|
|
57
|
+
declare type AnyColor = string | ObjectColor;
|
|
58
|
+
type ColorValue = number | AnyColor;
|
|
2
59
|
|
|
3
60
|
interface GradientFillDeclaration {
|
|
4
61
|
}
|
|
5
62
|
|
|
6
63
|
interface SolidFillDeclaration {
|
|
7
|
-
color:
|
|
64
|
+
color: ColorValue;
|
|
8
65
|
}
|
|
9
66
|
|
|
10
67
|
/**
|
|
@@ -69,7 +126,7 @@ interface GeometryPathStyle {
|
|
|
69
126
|
[key: string]: any;
|
|
70
127
|
opacity: number;
|
|
71
128
|
visibility: string;
|
|
72
|
-
shadowColor:
|
|
129
|
+
shadowColor: ColorValue;
|
|
73
130
|
shadowOffsetX: number;
|
|
74
131
|
shadowOffsetY: number;
|
|
75
132
|
shadowBlur: number;
|
|
@@ -110,8 +167,8 @@ interface IDOCNode {
|
|
|
110
167
|
interface OutlineDeclaration {
|
|
111
168
|
width?: number;
|
|
112
169
|
style?: 'dashed' | 'solid' | string;
|
|
113
|
-
|
|
114
|
-
color?:
|
|
170
|
+
src?: string;
|
|
171
|
+
color?: ColorValue;
|
|
115
172
|
opacity?: number;
|
|
116
173
|
}
|
|
117
174
|
type OutlineProperty = None | string | Partial<OutlineDeclaration>;
|
|
@@ -119,7 +176,7 @@ declare function normalizeOutline(outline?: OutlineProperty): OutlineDeclaration
|
|
|
119
176
|
|
|
120
177
|
type BoxShadow = None | string;
|
|
121
178
|
interface ShadowDeclaration {
|
|
122
|
-
color:
|
|
179
|
+
color: ColorValue;
|
|
123
180
|
offsetX?: number;
|
|
124
181
|
offsetY?: number;
|
|
125
182
|
blur?: number;
|
|
@@ -127,7 +184,7 @@ interface ShadowDeclaration {
|
|
|
127
184
|
type ShadowProperty = None | BoxShadow | ShadowDeclaration;
|
|
128
185
|
interface ShadowStyleDeclaration {
|
|
129
186
|
boxShadow: BoxShadow;
|
|
130
|
-
shadowColor?:
|
|
187
|
+
shadowColor?: ColorValue;
|
|
131
188
|
shadowOffsetX?: number;
|
|
132
189
|
shadowOffsetY?: number;
|
|
133
190
|
shadowBlur?: number;
|
|
@@ -231,13 +288,13 @@ declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
|
231
288
|
|
|
232
289
|
interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyleDeclaration, ShadowStyleDeclaration {
|
|
233
290
|
backgroundImage?: None | string;
|
|
234
|
-
backgroundColor?: None |
|
|
291
|
+
backgroundColor?: None | ColorValue;
|
|
235
292
|
borderRadius: number;
|
|
236
|
-
borderColor?: None |
|
|
293
|
+
borderColor?: None | ColorValue;
|
|
237
294
|
borderStyle: BorderStyle;
|
|
238
295
|
outlineWidth: number;
|
|
239
296
|
outlineOffset: number;
|
|
240
|
-
outlineColor: None |
|
|
297
|
+
outlineColor: None | ColorValue;
|
|
241
298
|
outlineStyle: string;
|
|
242
299
|
visibility: Visibility;
|
|
243
300
|
filter: string;
|
|
@@ -284,7 +341,7 @@ interface ListStyleStyleDeclaration {
|
|
|
284
341
|
declare function getDefaultListStyleStyle(): ListStyleStyleDeclaration;
|
|
285
342
|
|
|
286
343
|
interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
287
|
-
color:
|
|
344
|
+
color: ColorValue;
|
|
288
345
|
verticalAlign: VerticalAlign;
|
|
289
346
|
letterSpacing: number;
|
|
290
347
|
wordSpacing: number;
|
|
@@ -310,7 +367,7 @@ declare function getDefaultTextLineStyle(): TextLineStyleDeclaration;
|
|
|
310
367
|
|
|
311
368
|
interface TextDrawStyleDeclaration {
|
|
312
369
|
textStrokeWidth: number;
|
|
313
|
-
textStrokeColor:
|
|
370
|
+
textStrokeColor: ColorValue;
|
|
314
371
|
}
|
|
315
372
|
interface TextStyleDeclaration extends TextLineStyleDeclaration, TextInlineStyleDeclaration, TextDrawStyleDeclaration {
|
|
316
373
|
}
|
|
@@ -373,4 +430,4 @@ declare function normalizeDocument(doc: IDOCDocument): IDOCDocumentDeclaration;
|
|
|
373
430
|
|
|
374
431
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
375
432
|
|
|
376
|
-
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 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 };
|
|
433
|
+
export { type Align, type AnyColor, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, 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 HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, 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, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeDocument, normalizeElement, normalizeFill, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,67 @@
|
|
|
1
1
|
type None = 'none';
|
|
2
|
+
declare interface RgbColor {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
declare interface HslColor {
|
|
8
|
+
h: number;
|
|
9
|
+
s: number;
|
|
10
|
+
l: number;
|
|
11
|
+
}
|
|
12
|
+
declare interface HsvColor {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
v: number;
|
|
16
|
+
}
|
|
17
|
+
declare interface HwbColor {
|
|
18
|
+
h: number;
|
|
19
|
+
w: number;
|
|
20
|
+
b: number;
|
|
21
|
+
}
|
|
22
|
+
interface XyzColor {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
z: number;
|
|
26
|
+
}
|
|
27
|
+
interface LabColor {
|
|
28
|
+
l: number;
|
|
29
|
+
a: number;
|
|
30
|
+
b: number;
|
|
31
|
+
}
|
|
32
|
+
interface LchColor {
|
|
33
|
+
l: number;
|
|
34
|
+
c: number;
|
|
35
|
+
h: number;
|
|
36
|
+
}
|
|
37
|
+
interface CmykColor {
|
|
38
|
+
c: number;
|
|
39
|
+
m: number;
|
|
40
|
+
y: number;
|
|
41
|
+
k: number;
|
|
42
|
+
}
|
|
43
|
+
declare type WithAlpha<O> = O & {
|
|
44
|
+
a: number;
|
|
45
|
+
};
|
|
46
|
+
declare type RgbaColor = WithAlpha<RgbColor>;
|
|
47
|
+
declare type HslaColor = WithAlpha<HslColor>;
|
|
48
|
+
declare type HsvaColor = WithAlpha<HsvColor>;
|
|
49
|
+
declare type HwbaColor = WithAlpha<HwbColor>;
|
|
50
|
+
declare type XyzaColor = WithAlpha<XyzColor>;
|
|
51
|
+
declare type LabaColor = LabColor & {
|
|
52
|
+
alpha: number;
|
|
53
|
+
};
|
|
54
|
+
declare type LchaColor = WithAlpha<LchColor>;
|
|
55
|
+
declare type CmykaColor = WithAlpha<CmykColor>;
|
|
56
|
+
declare type ObjectColor = RgbColor | RgbaColor | HslColor | HslaColor | HsvColor | HsvaColor | HwbColor | HwbaColor | XyzColor | XyzaColor | LabColor | LabaColor | LchColor | LchaColor | CmykColor | CmykaColor;
|
|
57
|
+
declare type AnyColor = string | ObjectColor;
|
|
58
|
+
type ColorValue = number | AnyColor;
|
|
2
59
|
|
|
3
60
|
interface GradientFillDeclaration {
|
|
4
61
|
}
|
|
5
62
|
|
|
6
63
|
interface SolidFillDeclaration {
|
|
7
|
-
color:
|
|
64
|
+
color: ColorValue;
|
|
8
65
|
}
|
|
9
66
|
|
|
10
67
|
/**
|
|
@@ -69,7 +126,7 @@ interface GeometryPathStyle {
|
|
|
69
126
|
[key: string]: any;
|
|
70
127
|
opacity: number;
|
|
71
128
|
visibility: string;
|
|
72
|
-
shadowColor:
|
|
129
|
+
shadowColor: ColorValue;
|
|
73
130
|
shadowOffsetX: number;
|
|
74
131
|
shadowOffsetY: number;
|
|
75
132
|
shadowBlur: number;
|
|
@@ -110,8 +167,8 @@ interface IDOCNode {
|
|
|
110
167
|
interface OutlineDeclaration {
|
|
111
168
|
width?: number;
|
|
112
169
|
style?: 'dashed' | 'solid' | string;
|
|
113
|
-
|
|
114
|
-
color?:
|
|
170
|
+
src?: string;
|
|
171
|
+
color?: ColorValue;
|
|
115
172
|
opacity?: number;
|
|
116
173
|
}
|
|
117
174
|
type OutlineProperty = None | string | Partial<OutlineDeclaration>;
|
|
@@ -119,7 +176,7 @@ declare function normalizeOutline(outline?: OutlineProperty): OutlineDeclaration
|
|
|
119
176
|
|
|
120
177
|
type BoxShadow = None | string;
|
|
121
178
|
interface ShadowDeclaration {
|
|
122
|
-
color:
|
|
179
|
+
color: ColorValue;
|
|
123
180
|
offsetX?: number;
|
|
124
181
|
offsetY?: number;
|
|
125
182
|
blur?: number;
|
|
@@ -127,7 +184,7 @@ interface ShadowDeclaration {
|
|
|
127
184
|
type ShadowProperty = None | BoxShadow | ShadowDeclaration;
|
|
128
185
|
interface ShadowStyleDeclaration {
|
|
129
186
|
boxShadow: BoxShadow;
|
|
130
|
-
shadowColor?:
|
|
187
|
+
shadowColor?: ColorValue;
|
|
131
188
|
shadowOffsetX?: number;
|
|
132
189
|
shadowOffsetY?: number;
|
|
133
190
|
shadowBlur?: number;
|
|
@@ -231,13 +288,13 @@ declare function getDefaultTransformStyle(): TransformStyleDeclaration;
|
|
|
231
288
|
|
|
232
289
|
interface ElementStyleDeclaration extends LayoutStyleDeclaration, TransformStyleDeclaration, ShadowStyleDeclaration {
|
|
233
290
|
backgroundImage?: None | string;
|
|
234
|
-
backgroundColor?: None |
|
|
291
|
+
backgroundColor?: None | ColorValue;
|
|
235
292
|
borderRadius: number;
|
|
236
|
-
borderColor?: None |
|
|
293
|
+
borderColor?: None | ColorValue;
|
|
237
294
|
borderStyle: BorderStyle;
|
|
238
295
|
outlineWidth: number;
|
|
239
296
|
outlineOffset: number;
|
|
240
|
-
outlineColor: None |
|
|
297
|
+
outlineColor: None | ColorValue;
|
|
241
298
|
outlineStyle: string;
|
|
242
299
|
visibility: Visibility;
|
|
243
300
|
filter: string;
|
|
@@ -284,7 +341,7 @@ interface ListStyleStyleDeclaration {
|
|
|
284
341
|
declare function getDefaultListStyleStyle(): ListStyleStyleDeclaration;
|
|
285
342
|
|
|
286
343
|
interface TextInlineStyleDeclaration extends HighlightStyleDeclaration {
|
|
287
|
-
color:
|
|
344
|
+
color: ColorValue;
|
|
288
345
|
verticalAlign: VerticalAlign;
|
|
289
346
|
letterSpacing: number;
|
|
290
347
|
wordSpacing: number;
|
|
@@ -310,7 +367,7 @@ declare function getDefaultTextLineStyle(): TextLineStyleDeclaration;
|
|
|
310
367
|
|
|
311
368
|
interface TextDrawStyleDeclaration {
|
|
312
369
|
textStrokeWidth: number;
|
|
313
|
-
textStrokeColor:
|
|
370
|
+
textStrokeColor: ColorValue;
|
|
314
371
|
}
|
|
315
372
|
interface TextStyleDeclaration extends TextLineStyleDeclaration, TextInlineStyleDeclaration, TextDrawStyleDeclaration {
|
|
316
373
|
}
|
|
@@ -373,4 +430,4 @@ declare function normalizeDocument(doc: IDOCDocument): IDOCDocumentDeclaration;
|
|
|
373
430
|
|
|
374
431
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
375
432
|
|
|
376
|
-
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 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 };
|
|
433
|
+
export { type Align, type AnyColor, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, 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 HslColor, type HslaColor, type HsvColor, type HsvaColor, type HwbColor, type HwbaColor, type IDOCDocument, type IDOCDocumentDeclaration, type IDOCElement, type IDOCElementDeclaration, type IDOCNode, type Justify, type LabColor, type LabaColor, type LayoutStyleDeclaration, type LchColor, type LchaColor, type ListStyleColormap, type ListStyleDeclaration, type ListStyleImage, type ListStylePosition, type ListStyleSize, type ListStyleStyleDeclaration, type ListStyleType, type MetaProperty, type None, type ObjectColor, type OutlineDeclaration, type OutlineProperty, type Overflow, type ParagraphContent, type PointerEvents, type Position, type RgbColor, type RgbaColor, type SVGPathData, type ShadowDeclaration, type ShadowProperty, type ShadowStyleDeclaration, 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, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeDocument, normalizeElement, normalizeFill, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent };
|