diff --git a/docx-wasm/js/json/paragraph.ts b/docx-wasm/js/json/paragraph.ts index f091b0d..096ca07 100644 --- a/docx-wasm/js/json/paragraph.ts +++ b/docx-wasm/js/json/paragraph.ts @@ -1,8 +1,8 @@ import { RunJSON, RunPropertyJSON } from "./run"; import { IndentJSON } from "./indent"; import { - CommentRangeStartJSON, CommentRangeEndJSON, + CommentRangeStartJSON, SectionPropertyJSON, } from ".."; import { LineSpacingJSON } from "./line_spacing"; @@ -61,43 +61,47 @@ export type ParagraphJSON = { }; }; +export type InsertJSONData = { + children: ( + | DeleteJSON + | RunJSON + | CommentRangeStartJSON + | CommentRangeEndJSON + )[]; + author: string; + date: string; +}; + export type InsertJSON = { type: "insert"; - data: { - children: ( - | DeleteJSON - | RunJSON - | CommentRangeStartJSON - | CommentRangeEndJSON - )[]; - author: string; - date: string; - }; + data: InsertJSONData; +}; + +export type DeleteJSONData = { + children: DeleteChildJSON[]; + author: string; + date: string; }; export type DeleteJSON = { type: "delete"; - data: { - children: DeleteChildJSON[]; - author: string; - date: string; - }; + data: DeleteJSONData; }; export type HyperlinkJSON = { type: "hyperlink"; data: - | { - type: "external"; - rid: string; - children: HyperlinkChildJSON[]; - history: number | null; - } - | { - type: "anchor"; - anchor: string; - children: HyperlinkChildJSON[]; - }; + | { + type: "external"; + rid: string; + children: HyperlinkChildJSON[]; + history: number | null; + } + | { + type: "anchor"; + anchor: string; + children: HyperlinkChildJSON[]; + }; }; export type DeleteChildJSON = diff --git a/docx-wasm/js/json/run.ts b/docx-wasm/js/json/run.ts index 9d81e74..6f7606f 100644 --- a/docx-wasm/js/json/run.ts +++ b/docx-wasm/js/json/run.ts @@ -1,8 +1,7 @@ import { DrawingJSON } from "./drawing"; import { ShapeJSON } from "./shape"; -import { CommentRangeStartJSON, CommentRangeEndJSON } from ".."; +import { CommentRangeStartJSON, CommentRangeEndJSON, InsertJSONData, DeleteJSONData } from ".."; import { BorderType } from "../border"; -import { InsertJSON, DeleteJSON } from "./paragraph"; import { VertAlignType } from "../run"; import { FieldChar } from "./bindings/FieldChar"; import { InstrHyperlink } from "./bindings/InstrHyperlink"; @@ -43,8 +42,8 @@ export type RunPropertyJSON = { vanish?: boolean | null; spacing?: number | null; textBorder?: TextBorderJSON | null; - ins?: InsertJSON["data"] | null; - del?: DeleteJSON["data"] | null; + ins?: InsertJSONData | null; + del?: DeleteJSONData | null; strike?: boolean; }; @@ -103,14 +102,14 @@ export type FieldCharJSON = { export type InstrTextJSON = { type: "instrText"; data: - | { - type: "hyperlink"; - data: InstrHyperlink; - } - | { - type: "toc"; - data: InstrToC; - }; + | { + type: "hyperlink"; + data: InstrHyperlink; + } + | { + type: "toc"; + data: InstrToC; + }; }; export type InstrTextStringJSON = {