docx-wasm 0.4.11 → 0.4.12-beta1

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.
Files changed (37) hide show
  1. package/dist/node/index.js +5 -0
  2. package/dist/node/index.js.map +1 -1
  3. package/dist/node/json/bindings/PageNumType.d.ts +4 -0
  4. package/dist/node/json/bindings/PageNumType.js +3 -0
  5. package/dist/node/json/bindings/PageNumType.js.map +1 -0
  6. package/dist/node/json/footer.d.ts +2 -1
  7. package/dist/node/json/header.d.ts +2 -1
  8. package/dist/node/json/section-property.d.ts +3 -0
  9. package/dist/node/pkg/docx_wasm.d.ts +145 -129
  10. package/dist/node/pkg/docx_wasm.js +173 -125
  11. package/dist/node/pkg/docx_wasm_bg.wasm +0 -0
  12. package/dist/node/pkg/docx_wasm_bg.wasm.d.ts +57 -54
  13. package/dist/node/section-property.d.ts +6 -0
  14. package/dist/node/section-property.js +5 -0
  15. package/dist/node/section-property.js.map +1 -1
  16. package/dist/web/index.js +5 -0
  17. package/dist/web/index.js.map +1 -1
  18. package/dist/web/json/bindings/PageNumType.d.ts +4 -0
  19. package/dist/web/json/bindings/PageNumType.js +2 -0
  20. package/dist/web/json/bindings/PageNumType.js.map +1 -0
  21. package/dist/web/json/footer.d.ts +2 -1
  22. package/dist/web/json/header.d.ts +2 -1
  23. package/dist/web/json/section-property.d.ts +3 -0
  24. package/dist/web/pkg/docx_wasm.d.ts +145 -129
  25. package/dist/web/pkg/docx_wasm_bg.js +172 -125
  26. package/dist/web/pkg/docx_wasm_bg.wasm +0 -0
  27. package/dist/web/pkg/docx_wasm_bg.wasm.d.ts +57 -54
  28. package/dist/web/section-property.d.ts +6 -0
  29. package/dist/web/section-property.js +5 -0
  30. package/dist/web/section-property.js.map +1 -1
  31. package/js/index.ts +6 -0
  32. package/js/json/bindings/PageNumType.ts +2 -0
  33. package/js/json/footer.ts +2 -1
  34. package/js/json/header.ts +2 -1
  35. package/js/json/section-property.ts +4 -0
  36. package/js/section-property.ts +7 -0
  37. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { DocGridType } from ".";
2
2
  import { Footer } from "./footer";
3
3
  import { Header } from "./header";
4
+ import { PageNumType } from "./json/bindings/PageNumType";
4
5
  export declare type DocGrid = {
5
6
  gridType: DocGridType;
6
7
  linePitch?: number;
@@ -16,6 +17,7 @@ export declare class SectionProperty {
16
17
  _footer: Footer | null;
17
18
  _firstFooter: Footer | null;
18
19
  _evenFooter: Footer | null;
20
+ _pageTypeNum: PageNumType | null;
19
21
  pageSize(w: number, h: number): this;
20
22
  pageMargin(margin: Partial<PageMargin>): this;
21
23
  pageOrientation(orient: PageOrientationType): this;
@@ -26,6 +28,10 @@ export declare class SectionProperty {
26
28
  footer(footer: Footer): this;
27
29
  firstFooter(footer: Footer): this;
28
30
  evenFooter(footer: Footer): this;
31
+ pageTypeNum({ start, chapStyle }: {
32
+ start: number;
33
+ chapStyle: string;
34
+ }): this;
29
35
  }
30
36
  export declare type PageOrientationType = "landscape" | "portrait";
31
37
  export declare type PageSize = {
@@ -12,6 +12,7 @@ export class SectionProperty {
12
12
  this._footer = null;
13
13
  this._firstFooter = null;
14
14
  this._evenFooter = null;
15
+ this._pageTypeNum = null;
15
16
  }
16
17
  pageSize(w, h) {
17
18
  this._pageSize.w = w;
@@ -54,6 +55,10 @@ export class SectionProperty {
54
55
  this._evenFooter = footer;
55
56
  return this;
56
57
  }
58
+ pageTypeNum({ start, chapStyle }) {
59
+ this._pageTypeNum = { start, chapStyle };
60
+ return this;
61
+ }
57
62
  }
58
63
  export const defaultPageMargin = () => {
59
64
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"section-property.js","sourceRoot":"","sources":["../../js/section-property.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,eAAe;IAA5B;QACE,cAAS,GAAa;YACpB,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,KAAK;SACT,CAAC;QACF,gBAAW,GAAsB,IAAI,CAAC;QACtC,aAAQ,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QACX,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC,CAAC"}
package/js/index.ts CHANGED
@@ -517,6 +517,12 @@ export class Docx {
517
517
  }
518
518
  }
519
519
 
520
+ if (this.sectionProperty._pageTypeNum) {
521
+ const { start, chapStyle } = this.sectionProperty._pageTypeNum;
522
+ const p = wasm.createPageNumType(start, chapStyle);
523
+ docx = docx.page_num_type(p);
524
+ }
525
+
520
526
  if (this.sectionProperty._docGrid) {
521
527
  const { gridType, charSpace, linePitch } = this.sectionProperty._docGrid;
522
528
  let type = wasm.DocGridType.Default;
@@ -0,0 +1,2 @@
1
+
2
+ export interface PageNumType { start?: number, chapStyle?: string, }
package/js/json/footer.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ParagraphJSON } from "./paragraph";
2
+ import { StructuredTagJSON } from "./structured-data-tag";
2
3
  import { TableJSON } from "./table";
3
4
 
4
5
  export type FooterJSON = {
5
- children: (ParagraphJSON | TableJSON)[];
6
+ children: (ParagraphJSON | TableJSON | StructuredTagJSON)[];
6
7
  };
7
8
 
8
9
  export type FooterReferenceJSON = {
package/js/json/header.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { ParagraphJSON } from "./paragraph";
2
+ import { StructuredTagJSON } from "./structured-data-tag";
2
3
  import { TableJSON } from "./table";
3
4
 
4
5
  export type HeaderJSON = {
5
- children: (ParagraphJSON | TableJSON)[];
6
+ children: (ParagraphJSON | TableJSON | StructuredTagJSON)[];
6
7
  };
7
8
 
8
9
  export type HeaderReferenceJSON = {
@@ -1,5 +1,8 @@
1
1
  import { HeaderJSON, HeaderReferenceJSON } from "./header";
2
2
  import { FooterJSON, FooterReferenceJSON } from "./footer";
3
+ import { PageNumType as PageNumTypeJSON } from "./bindings/PageNumType";
4
+
5
+ export { PageNumType as PageNumTypeJSON } from "./bindings/PageNumType";
3
6
 
4
7
  export type DocGridType = "default" | "lines" | "linesAndChars" | "snapToChars";
5
8
 
@@ -48,4 +51,5 @@ export type SectionPropertyJSON = {
48
51
  firstFooter?: FooterJSON;
49
52
  evenFooterReference?: FooterReferenceJSON;
50
53
  evenFooter?: FooterJSON;
54
+ pageNumType?: PageNumTypeJSON;
51
55
  };
@@ -1,6 +1,7 @@
1
1
  import { DocGridType } from ".";
2
2
  import { Footer } from "./footer";
3
3
  import { Header } from "./header";
4
+ import { PageNumType } from "./json/bindings/PageNumType";
4
5
 
5
6
  export type DocGrid = {
6
7
  gridType: DocGridType;
@@ -21,6 +22,7 @@ export class SectionProperty {
21
22
  _footer: Footer | null = null;
22
23
  _firstFooter: Footer | null = null;
23
24
  _evenFooter: Footer | null = null;
25
+ _pageTypeNum: PageNumType | null = null;
24
26
 
25
27
  pageSize(w: number, h: number) {
26
28
  this._pageSize.w = w;
@@ -72,6 +74,11 @@ export class SectionProperty {
72
74
  this._evenFooter = footer;
73
75
  return this;
74
76
  }
77
+
78
+ pageTypeNum({ start, chapStyle }: { start: number; chapStyle: string }) {
79
+ this._pageTypeNum = { start, chapStyle };
80
+ return this;
81
+ }
75
82
  }
76
83
 
77
84
  export type PageOrientationType = "landscape" | "portrait";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docx-wasm",
3
- "version": "0.4.11",
3
+ "version": "0.4.12-beta1",
4
4
  "main": "dist/node/index.js",
5
5
  "browser": "dist/web/index.js",
6
6
  "author": "bokuweb <bokuweb12@gmail.com>",