refactor: define type instead of IndexAccessType (#549)
parent
0ab6c08ea1
commit
3609b7e639
|
@ -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 =
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue