modern-idoc 0.8.2 → 0.8.4
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 +9 -2
- package/dist/index.d.cts +7 -7
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,13 @@
|
|
|
18
18
|
</a>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## 📦 Install
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
npm i modern-idoc
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 🦄 Usage
|
|
22
28
|
|
|
23
29
|
```ts
|
|
24
30
|
import type { Document } from 'modern-idoc'
|
|
@@ -85,4 +91,5 @@ const pdf: Document = {
|
|
|
85
91
|
- [modern-text](https://github.com/qq15725/modern-text) text renderer
|
|
86
92
|
- [modern-pdf](https://github.com/qq15725/modern-pdf) PDF codec
|
|
87
93
|
- [modern-openxml](https://github.com/qq15725/modern-openxml) PPTX、etc... codec
|
|
88
|
-
- [modern-canvas](https://github.com/qq15725/modern-canvas) IDoc WebGL renderer
|
|
94
|
+
- [modern-canvas](https://github.com/qq15725/modern-canvas) IDoc to WebGL renderer
|
|
95
|
+
- [modern-idoc-svg](https://github.com/qq15725/modern-idoc-svg) IDoc to SVG renderer
|
package/dist/index.d.cts
CHANGED
|
@@ -374,9 +374,9 @@ interface NormalizedEffect {
|
|
|
374
374
|
softEdge?: NormalizedSoftEdge;
|
|
375
375
|
}
|
|
376
376
|
interface EffectObject {
|
|
377
|
-
innerShadow
|
|
378
|
-
outerShadow
|
|
379
|
-
softEdge
|
|
377
|
+
innerShadow?: WithNone<InnerShadow>;
|
|
378
|
+
outerShadow?: WithNone<OuterShadow>;
|
|
379
|
+
softEdge?: WithNone<SoftEdge>;
|
|
380
380
|
}
|
|
381
381
|
type Effect = EffectObject;
|
|
382
382
|
declare function normalizeEffect(effect: Effect): NormalizedEffect;
|
|
@@ -699,7 +699,7 @@ interface NormalizedText {
|
|
|
699
699
|
measureDom?: any;
|
|
700
700
|
fonts?: any;
|
|
701
701
|
}
|
|
702
|
-
type Text = string | (Omit<NormalizedText, 'content'> & {
|
|
702
|
+
type Text = string | TextContent | (Omit<NormalizedText, 'content'> & {
|
|
703
703
|
content: TextContent;
|
|
704
704
|
});
|
|
705
705
|
declare function hasCRLF(content: string): boolean;
|
|
@@ -716,7 +716,7 @@ interface NormalizedVideo {
|
|
|
716
716
|
type Video = string | NormalizedVideo;
|
|
717
717
|
declare function normalizeVideo(video: Video): NormalizedVideo | undefined;
|
|
718
718
|
|
|
719
|
-
interface Element<T = Meta> extends Node<T> {
|
|
719
|
+
interface Element<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
720
720
|
id?: string;
|
|
721
721
|
style?: WithNone<Style>;
|
|
722
722
|
text?: WithNone<Text>;
|
|
@@ -731,7 +731,7 @@ interface Element<T = Meta> extends Node<T> {
|
|
|
731
731
|
effect?: WithNone<Effect>;
|
|
732
732
|
children?: Element[];
|
|
733
733
|
}
|
|
734
|
-
|
|
734
|
+
interface NormalizedElement<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
735
735
|
id: string;
|
|
736
736
|
style?: Partial<NormalizedStyle>;
|
|
737
737
|
text?: NormalizedText;
|
|
@@ -745,7 +745,7 @@ type NormalizedElement<T = Meta> = Node<T> & {
|
|
|
745
745
|
audio?: NormalizedAudio;
|
|
746
746
|
effect?: NormalizedEffect;
|
|
747
747
|
children?: NormalizedElement[];
|
|
748
|
-
}
|
|
748
|
+
}
|
|
749
749
|
declare function normalizeElement<T = Meta>(element: Element<T>): NormalizedElement<T>;
|
|
750
750
|
|
|
751
751
|
interface Document extends Element {
|
package/dist/index.d.mts
CHANGED
|
@@ -374,9 +374,9 @@ interface NormalizedEffect {
|
|
|
374
374
|
softEdge?: NormalizedSoftEdge;
|
|
375
375
|
}
|
|
376
376
|
interface EffectObject {
|
|
377
|
-
innerShadow
|
|
378
|
-
outerShadow
|
|
379
|
-
softEdge
|
|
377
|
+
innerShadow?: WithNone<InnerShadow>;
|
|
378
|
+
outerShadow?: WithNone<OuterShadow>;
|
|
379
|
+
softEdge?: WithNone<SoftEdge>;
|
|
380
380
|
}
|
|
381
381
|
type Effect = EffectObject;
|
|
382
382
|
declare function normalizeEffect(effect: Effect): NormalizedEffect;
|
|
@@ -699,7 +699,7 @@ interface NormalizedText {
|
|
|
699
699
|
measureDom?: any;
|
|
700
700
|
fonts?: any;
|
|
701
701
|
}
|
|
702
|
-
type Text = string | (Omit<NormalizedText, 'content'> & {
|
|
702
|
+
type Text = string | TextContent | (Omit<NormalizedText, 'content'> & {
|
|
703
703
|
content: TextContent;
|
|
704
704
|
});
|
|
705
705
|
declare function hasCRLF(content: string): boolean;
|
|
@@ -716,7 +716,7 @@ interface NormalizedVideo {
|
|
|
716
716
|
type Video = string | NormalizedVideo;
|
|
717
717
|
declare function normalizeVideo(video: Video): NormalizedVideo | undefined;
|
|
718
718
|
|
|
719
|
-
interface Element<T = Meta> extends Node<T> {
|
|
719
|
+
interface Element<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
720
720
|
id?: string;
|
|
721
721
|
style?: WithNone<Style>;
|
|
722
722
|
text?: WithNone<Text>;
|
|
@@ -731,7 +731,7 @@ interface Element<T = Meta> extends Node<T> {
|
|
|
731
731
|
effect?: WithNone<Effect>;
|
|
732
732
|
children?: Element[];
|
|
733
733
|
}
|
|
734
|
-
|
|
734
|
+
interface NormalizedElement<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
735
735
|
id: string;
|
|
736
736
|
style?: Partial<NormalizedStyle>;
|
|
737
737
|
text?: NormalizedText;
|
|
@@ -745,7 +745,7 @@ type NormalizedElement<T = Meta> = Node<T> & {
|
|
|
745
745
|
audio?: NormalizedAudio;
|
|
746
746
|
effect?: NormalizedEffect;
|
|
747
747
|
children?: NormalizedElement[];
|
|
748
|
-
}
|
|
748
|
+
}
|
|
749
749
|
declare function normalizeElement<T = Meta>(element: Element<T>): NormalizedElement<T>;
|
|
750
750
|
|
|
751
751
|
interface Document extends Element {
|
package/dist/index.d.ts
CHANGED
|
@@ -374,9 +374,9 @@ interface NormalizedEffect {
|
|
|
374
374
|
softEdge?: NormalizedSoftEdge;
|
|
375
375
|
}
|
|
376
376
|
interface EffectObject {
|
|
377
|
-
innerShadow
|
|
378
|
-
outerShadow
|
|
379
|
-
softEdge
|
|
377
|
+
innerShadow?: WithNone<InnerShadow>;
|
|
378
|
+
outerShadow?: WithNone<OuterShadow>;
|
|
379
|
+
softEdge?: WithNone<SoftEdge>;
|
|
380
380
|
}
|
|
381
381
|
type Effect = EffectObject;
|
|
382
382
|
declare function normalizeEffect(effect: Effect): NormalizedEffect;
|
|
@@ -699,7 +699,7 @@ interface NormalizedText {
|
|
|
699
699
|
measureDom?: any;
|
|
700
700
|
fonts?: any;
|
|
701
701
|
}
|
|
702
|
-
type Text = string | (Omit<NormalizedText, 'content'> & {
|
|
702
|
+
type Text = string | TextContent | (Omit<NormalizedText, 'content'> & {
|
|
703
703
|
content: TextContent;
|
|
704
704
|
});
|
|
705
705
|
declare function hasCRLF(content: string): boolean;
|
|
@@ -716,7 +716,7 @@ interface NormalizedVideo {
|
|
|
716
716
|
type Video = string | NormalizedVideo;
|
|
717
717
|
declare function normalizeVideo(video: Video): NormalizedVideo | undefined;
|
|
718
718
|
|
|
719
|
-
interface Element<T = Meta> extends Node<T> {
|
|
719
|
+
interface Element<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
720
720
|
id?: string;
|
|
721
721
|
style?: WithNone<Style>;
|
|
722
722
|
text?: WithNone<Text>;
|
|
@@ -731,7 +731,7 @@ interface Element<T = Meta> extends Node<T> {
|
|
|
731
731
|
effect?: WithNone<Effect>;
|
|
732
732
|
children?: Element[];
|
|
733
733
|
}
|
|
734
|
-
|
|
734
|
+
interface NormalizedElement<T = Meta> extends Omit<Node<T>, 'children'> {
|
|
735
735
|
id: string;
|
|
736
736
|
style?: Partial<NormalizedStyle>;
|
|
737
737
|
text?: NormalizedText;
|
|
@@ -745,7 +745,7 @@ type NormalizedElement<T = Meta> = Node<T> & {
|
|
|
745
745
|
audio?: NormalizedAudio;
|
|
746
746
|
effect?: NormalizedEffect;
|
|
747
747
|
children?: NormalizedElement[];
|
|
748
|
-
}
|
|
748
|
+
}
|
|
749
749
|
declare function normalizeElement<T = Meta>(element: Element<T>): NormalizedElement<T>;
|
|
750
750
|
|
|
751
751
|
interface Document extends Element {
|