modern-idoc 0.3.5 → 0.4.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 +6 -6
- package/dist/index.d.cts +11 -11
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
|
-
import type {
|
|
24
|
+
import type { Document } from 'modern-idoc'
|
|
25
25
|
|
|
26
|
-
const pdf:
|
|
26
|
+
const pdf: Document = {
|
|
27
27
|
children: [
|
|
28
28
|
{
|
|
29
29
|
style: { width: 300, height: 600 },
|
|
@@ -82,7 +82,7 @@ const pdf: IDOCDocument = {
|
|
|
82
82
|
|
|
83
83
|
## Refer to these packages for usage
|
|
84
84
|
|
|
85
|
-
- [modern-text](https://github.com/qq15725/modern-text)
|
|
86
|
-
- [modern-pdf](https://github.com/qq15725/modern-pdf)
|
|
87
|
-
- [modern-openxml](https://github.com/qq15725/modern-openxml)
|
|
88
|
-
- [modern-canvas](https://github.com/qq15725/modern-canvas)
|
|
85
|
+
- [modern-text](https://github.com/qq15725/modern-text) text renderer
|
|
86
|
+
- [modern-pdf](https://github.com/qq15725/modern-pdf) PDF codec
|
|
87
|
+
- [modern-openxml](https://github.com/qq15725/modern-openxml) PPTX、etc... codec
|
|
88
|
+
- [modern-canvas](https://github.com/qq15725/modern-canvas) IDoc WebGL renderer
|
package/dist/index.d.cts
CHANGED
|
@@ -166,9 +166,9 @@ interface MetaProperty {
|
|
|
166
166
|
[key: string]: any;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
interface
|
|
169
|
+
interface Node<T = MetaProperty> {
|
|
170
170
|
name?: string;
|
|
171
|
-
children?:
|
|
171
|
+
children?: Node[];
|
|
172
172
|
meta?: T;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -413,7 +413,7 @@ interface VideoDeclaration {
|
|
|
413
413
|
type VideoProperty = None | string | VideoDeclaration;
|
|
414
414
|
declare function normalizeVideo(video?: VideoProperty): VideoDeclaration | undefined;
|
|
415
415
|
|
|
416
|
-
interface
|
|
416
|
+
interface Element<T = MetaProperty> extends Node<T> {
|
|
417
417
|
style?: StyleProperty;
|
|
418
418
|
text?: TextProperty;
|
|
419
419
|
background?: BackgroundProperty;
|
|
@@ -424,9 +424,9 @@ interface IDOCElement<T = MetaProperty> extends IDOCNode<T> {
|
|
|
424
424
|
shadow?: ShadowProperty;
|
|
425
425
|
video?: VideoProperty;
|
|
426
426
|
audio?: AudioProperty;
|
|
427
|
-
children?:
|
|
427
|
+
children?: Element[];
|
|
428
428
|
}
|
|
429
|
-
interface
|
|
429
|
+
interface ElementDeclaration<T = MetaProperty> extends Element<T> {
|
|
430
430
|
text?: TextDeclaration;
|
|
431
431
|
background?: BackgroundDeclaration;
|
|
432
432
|
geometry?: GeometryDeclaration;
|
|
@@ -436,18 +436,18 @@ interface IDOCElementDeclaration<T = MetaProperty> extends IDOCElement<T> {
|
|
|
436
436
|
shadow?: ShadowDeclaration;
|
|
437
437
|
video?: VideoDeclaration;
|
|
438
438
|
audio?: AudioDeclaration;
|
|
439
|
-
children?:
|
|
439
|
+
children?: ElementDeclaration[];
|
|
440
440
|
}
|
|
441
|
-
declare function normalizeElement<T = MetaProperty>(element:
|
|
441
|
+
declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
|
|
442
442
|
|
|
443
|
-
interface
|
|
443
|
+
interface Document extends Element {
|
|
444
444
|
fonts?: any;
|
|
445
445
|
}
|
|
446
|
-
interface
|
|
446
|
+
interface DocumentDeclaration extends ElementDeclaration {
|
|
447
447
|
fonts?: any;
|
|
448
448
|
}
|
|
449
|
-
declare function normalizeDocument(doc:
|
|
449
|
+
declare function normalizeDocument(doc: Document): DocumentDeclaration;
|
|
450
450
|
|
|
451
451
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
452
452
|
|
|
453
|
-
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, 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 ForegroundDeclaration, type ForegroundProperty, 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
|
|
453
|
+
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, 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 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 Node, 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 VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
|
package/dist/index.d.mts
CHANGED
|
@@ -166,9 +166,9 @@ interface MetaProperty {
|
|
|
166
166
|
[key: string]: any;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
interface
|
|
169
|
+
interface Node<T = MetaProperty> {
|
|
170
170
|
name?: string;
|
|
171
|
-
children?:
|
|
171
|
+
children?: Node[];
|
|
172
172
|
meta?: T;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -413,7 +413,7 @@ interface VideoDeclaration {
|
|
|
413
413
|
type VideoProperty = None | string | VideoDeclaration;
|
|
414
414
|
declare function normalizeVideo(video?: VideoProperty): VideoDeclaration | undefined;
|
|
415
415
|
|
|
416
|
-
interface
|
|
416
|
+
interface Element<T = MetaProperty> extends Node<T> {
|
|
417
417
|
style?: StyleProperty;
|
|
418
418
|
text?: TextProperty;
|
|
419
419
|
background?: BackgroundProperty;
|
|
@@ -424,9 +424,9 @@ interface IDOCElement<T = MetaProperty> extends IDOCNode<T> {
|
|
|
424
424
|
shadow?: ShadowProperty;
|
|
425
425
|
video?: VideoProperty;
|
|
426
426
|
audio?: AudioProperty;
|
|
427
|
-
children?:
|
|
427
|
+
children?: Element[];
|
|
428
428
|
}
|
|
429
|
-
interface
|
|
429
|
+
interface ElementDeclaration<T = MetaProperty> extends Element<T> {
|
|
430
430
|
text?: TextDeclaration;
|
|
431
431
|
background?: BackgroundDeclaration;
|
|
432
432
|
geometry?: GeometryDeclaration;
|
|
@@ -436,18 +436,18 @@ interface IDOCElementDeclaration<T = MetaProperty> extends IDOCElement<T> {
|
|
|
436
436
|
shadow?: ShadowDeclaration;
|
|
437
437
|
video?: VideoDeclaration;
|
|
438
438
|
audio?: AudioDeclaration;
|
|
439
|
-
children?:
|
|
439
|
+
children?: ElementDeclaration[];
|
|
440
440
|
}
|
|
441
|
-
declare function normalizeElement<T = MetaProperty>(element:
|
|
441
|
+
declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
|
|
442
442
|
|
|
443
|
-
interface
|
|
443
|
+
interface Document extends Element {
|
|
444
444
|
fonts?: any;
|
|
445
445
|
}
|
|
446
|
-
interface
|
|
446
|
+
interface DocumentDeclaration extends ElementDeclaration {
|
|
447
447
|
fonts?: any;
|
|
448
448
|
}
|
|
449
|
-
declare function normalizeDocument(doc:
|
|
449
|
+
declare function normalizeDocument(doc: Document): DocumentDeclaration;
|
|
450
450
|
|
|
451
451
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
452
452
|
|
|
453
|
-
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, 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 ForegroundDeclaration, type ForegroundProperty, 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
|
|
453
|
+
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, 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 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 Node, 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 VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
|
package/dist/index.d.ts
CHANGED
|
@@ -166,9 +166,9 @@ interface MetaProperty {
|
|
|
166
166
|
[key: string]: any;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
interface
|
|
169
|
+
interface Node<T = MetaProperty> {
|
|
170
170
|
name?: string;
|
|
171
|
-
children?:
|
|
171
|
+
children?: Node[];
|
|
172
172
|
meta?: T;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -413,7 +413,7 @@ interface VideoDeclaration {
|
|
|
413
413
|
type VideoProperty = None | string | VideoDeclaration;
|
|
414
414
|
declare function normalizeVideo(video?: VideoProperty): VideoDeclaration | undefined;
|
|
415
415
|
|
|
416
|
-
interface
|
|
416
|
+
interface Element<T = MetaProperty> extends Node<T> {
|
|
417
417
|
style?: StyleProperty;
|
|
418
418
|
text?: TextProperty;
|
|
419
419
|
background?: BackgroundProperty;
|
|
@@ -424,9 +424,9 @@ interface IDOCElement<T = MetaProperty> extends IDOCNode<T> {
|
|
|
424
424
|
shadow?: ShadowProperty;
|
|
425
425
|
video?: VideoProperty;
|
|
426
426
|
audio?: AudioProperty;
|
|
427
|
-
children?:
|
|
427
|
+
children?: Element[];
|
|
428
428
|
}
|
|
429
|
-
interface
|
|
429
|
+
interface ElementDeclaration<T = MetaProperty> extends Element<T> {
|
|
430
430
|
text?: TextDeclaration;
|
|
431
431
|
background?: BackgroundDeclaration;
|
|
432
432
|
geometry?: GeometryDeclaration;
|
|
@@ -436,18 +436,18 @@ interface IDOCElementDeclaration<T = MetaProperty> extends IDOCElement<T> {
|
|
|
436
436
|
shadow?: ShadowDeclaration;
|
|
437
437
|
video?: VideoDeclaration;
|
|
438
438
|
audio?: AudioDeclaration;
|
|
439
|
-
children?:
|
|
439
|
+
children?: ElementDeclaration[];
|
|
440
440
|
}
|
|
441
|
-
declare function normalizeElement<T = MetaProperty>(element:
|
|
441
|
+
declare function normalizeElement<T = MetaProperty>(element: Element<T>): ElementDeclaration<T>;
|
|
442
442
|
|
|
443
|
-
interface
|
|
443
|
+
interface Document extends Element {
|
|
444
444
|
fonts?: any;
|
|
445
445
|
}
|
|
446
|
-
interface
|
|
446
|
+
interface DocumentDeclaration extends ElementDeclaration {
|
|
447
447
|
fonts?: any;
|
|
448
448
|
}
|
|
449
|
-
declare function normalizeDocument(doc:
|
|
449
|
+
declare function normalizeDocument(doc: Document): DocumentDeclaration;
|
|
450
450
|
|
|
451
451
|
declare function clearUndef<T>(obj: T, deep?: boolean): T;
|
|
452
452
|
|
|
453
|
-
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, 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 ForegroundDeclaration, type ForegroundProperty, 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
|
|
453
|
+
export { type Align, type AnyColor, type AudioDeclaration, type AudioProperty, type BackgroundDeclaration, type BackgroundProperty, type BorderStyle, type BoxShadow, type BoxSizing, type CmykColor, type CmykaColor, type ColorValue, type Direction, type Display, type Document, type DocumentDeclaration, type Element, type ElementDeclaration, type ElementStyleDeclaration, type FillDeclaration, type FillProperty, type FillRule, type FlexDirection, type FlexWrap, type FontKerning, type FontStyle, type FontWeight, type ForegroundDeclaration, type ForegroundProperty, 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 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 Node, 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 VideoDeclaration, type VideoProperty, type Visibility, type WritingMode, type XyzColor, type XyzaColor, clearUndef, getDefaultElementStyle, getDefaultHighlightStyle, getDefaultLayoutStyle, getDefaultListStyleStyle, getDefaultShadowStyle, getDefaultStyle, getDefaultTextInlineStyle, getDefaultTextLineStyle, getDefaultTextStyle, getDefaultTransformStyle, normalizeAudio, normalizeBackground, normalizeDocument, normalizeElement, normalizeFill, normalizeForeground, normalizeGeometry, normalizeOutline, normalizeShadow, normalizeText, normalizeTextContent, normalizeVideo };
|