From d0455d7c089a0dce06431f369f9a5e4e4a6a8865 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Mon, 12 Oct 2020 17:51:28 +0900 Subject: [PATCH] Expose section prop (#173) * chore: expose section props * 0.0.107 --- docx-wasm/js/json/document.ts | 19 ++----------------- docx-wasm/js/json/index.ts | 1 + docx-wasm/js/json/section-property.ts | 17 +++++++++++++++++ docx-wasm/package.json | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 docx-wasm/js/json/section-property.ts diff --git a/docx-wasm/js/json/document.ts b/docx-wasm/js/json/document.ts index ee8098d..7cc90b4 100644 --- a/docx-wasm/js/json/document.ts +++ b/docx-wasm/js/json/document.ts @@ -1,5 +1,6 @@ import { ParagraphJSON, BookmarkStartJSON, BookmarkEndJSON } from "./paragraph"; import { TableJSON } from "./table"; +import { SectionPropertyJSON } from "./section-property"; export type DocumentChildJSON = | ParagraphJSON @@ -9,22 +10,6 @@ export type DocumentChildJSON = export type DocumentJSON = { children: DocumentChildJSON[]; - sectionProperty: { - pageSize: { - w: number; - h: number; - }; - pageMargin: { - top: number; - left: number; - bottom: number; - right: number; - header: number; - footer: number; - gutter: number; - }; - columns: number; - documentGrid: number; - }; + sectionProperty: SectionPropertyJSON; hasNumbering: boolean; }; diff --git a/docx-wasm/js/json/index.ts b/docx-wasm/js/json/index.ts index 378232d..b9317cb 100644 --- a/docx-wasm/js/json/index.ts +++ b/docx-wasm/js/json/index.ts @@ -52,3 +52,4 @@ export * from "./table"; export * from "./numbering"; export * from "./drawing"; export * from "./textbox-content"; +export * from "./section-property"; diff --git a/docx-wasm/js/json/section-property.ts b/docx-wasm/js/json/section-property.ts new file mode 100644 index 0000000..c22bf3c --- /dev/null +++ b/docx-wasm/js/json/section-property.ts @@ -0,0 +1,17 @@ +export type SectionPropertyJSON = { + pageSize: { + w: number; + h: number; + }; + pageMargin: { + top: number; + left: number; + bottom: number; + right: number; + header: number; + footer: number; + gutter: number; + }; + columns: number; + documentGrid: number; +}; diff --git a/docx-wasm/package.json b/docx-wasm/package.json index 3306990..5c64061 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,6 +1,6 @@ { "name": "docx-wasm", - "version": "0.0.105", + "version": "0.0.107", "main": "dist/node/index.js", "browser": "dist/web/index.js", "author": "bokuweb ",