docx-rs/docx-wasm/js/json/paragraph.ts

72 lines
1.4 KiB
TypeScript
Raw Normal View History

import { RunJSON, RunChildJSON, RunPropertyJSON } from "./run";
2020-02-27 20:12:36 +02:00
import { IndentJSON } from "./indent";
import { CommentRangeStartJSON, CommentRangeEndJSON } from "..";
export type ParagraphChildJSON =
| RunJSON
| InsertJSON
| DeleteJSON
| CommentRangeStartJSON
| CommentRangeEndJSON
| BookmarkStartJSON
| BookmarkEndJSON;
export type NumberingPropertyJSON = {
id: number | null;
level: number | null;
};
export type ParagraphPropertyJSON = {
runProperty: RunPropertyJSON;
style: string | null;
numberingProperty: NumberingPropertyJSON | null;
alignment: "left" | "center" | "right" | "justified" | "both";
2020-02-27 20:12:36 +02:00
indent: IndentJSON | null;
lineHeight: number | null;
};
export type ParagraphJSON = {
type: "paragraph";
data: {
id: string;
property: ParagraphPropertyJSON;
children: ParagraphChildJSON[];
};
};
export type InsertJSON = {
type: "insert";
data: {
children: (DeleteJSON | RunJSON)[];
author: string;
data: string;
};
};
export type DeleteJSON = {
type: "delete";
data: {
runs: {
runProperty: RunPropertyJSON;
children: RunChildJSON[];
}[];
author: string;
data: string;
};
};
export type BookmarkStartJSON = {
type: "bookmarkStart";
data: {
id: number;
name: string;
};
};
export type BookmarkEndJSON = {
type: "bookmarkEnd";
data: {
id: number;
};
};