fix: alignemnt type (#567)

* fix: alignemnt type

* fix
main
bokuweb 2022-11-07 10:53:11 +09:00 committed by GitHub
parent f8928f0c77
commit 0ab5869343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 13 deletions

View File

@ -10,6 +10,7 @@ pub enum AlignmentType {
Both, Both,
Center, Center,
Distribute, Distribute,
Start,
End, End,
Left, Left,
Right, Right,
@ -24,6 +25,7 @@ impl fmt::Display for AlignmentType {
AlignmentType::Left => write!(f, "left"), AlignmentType::Left => write!(f, "left"),
AlignmentType::Distribute => write!(f, "distribute"), AlignmentType::Distribute => write!(f, "distribute"),
AlignmentType::Right => write!(f, "right"), AlignmentType::Right => write!(f, "right"),
AlignmentType::Start => write!(f, "start"),
AlignmentType::End => write!(f, "end"), AlignmentType::End => write!(f, "end"),
AlignmentType::Both => write!(f, "both"), AlignmentType::Both => write!(f, "both"),
AlignmentType::Justified => write!(f, "justified"), AlignmentType::Justified => write!(f, "justified"),
@ -41,6 +43,7 @@ impl FromStr for AlignmentType {
"distribute" => Ok(AlignmentType::Distribute), "distribute" => Ok(AlignmentType::Distribute),
"center" => Ok(AlignmentType::Center), "center" => Ok(AlignmentType::Center),
"both" => Ok(AlignmentType::Both), "both" => Ok(AlignmentType::Both),
"start" => Ok(AlignmentType::Start),
"end" => Ok(AlignmentType::End), "end" => Ok(AlignmentType::End),
"justified" => Ok(AlignmentType::Justified), "justified" => Ok(AlignmentType::Justified),
_ => Ok(AlignmentType::Unsupported), _ => Ok(AlignmentType::Unsupported),

View File

@ -35,7 +35,15 @@ export type ParagraphPropertyJSON = {
runProperty: RunPropertyJSON; runProperty: RunPropertyJSON;
style?: string | null; style?: string | null;
numberingProperty?: NumberingPropertyJSON | null; numberingProperty?: NumberingPropertyJSON | null;
alignment?: "left" | "center" | "right" | "justified" | "both"; alignment?:
| "left"
| "center"
| "right"
| "justified"
| "both"
| "start"
| "end"
| "unsupported";
indent?: IndentJSON | null; indent?: IndentJSON | null;
lineSpacing?: LineSpacingJSON | null; lineSpacing?: LineSpacingJSON | null;
divId?: string | null; divId?: string | null;
@ -91,17 +99,17 @@ export type DeleteJSON = {
export type HyperlinkJSON = { export type HyperlinkJSON = {
type: "hyperlink"; type: "hyperlink";
data: data:
| { | {
type: "external"; type: "external";
rid: string; rid: string;
children: HyperlinkChildJSON[]; children: HyperlinkChildJSON[];
history: number | null; history: number | null;
} }
| { | {
type: "anchor"; type: "anchor";
anchor: string; anchor: string;
children: HyperlinkChildJSON[]; children: HyperlinkChildJSON[];
}; };
}; };
export type DeleteChildJSON = export type DeleteChildJSON =

View File

@ -1,6 +1,6 @@
{ {
"name": "docx-wasm", "name": "docx-wasm",
"version": "0.0.276-rc34", "version": "0.0.276-rc35",
"main": "dist/node/index.js", "main": "dist/node/index.js",
"browser": "dist/web/index.js", "browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>", "author": "bokuweb <bokuweb12@gmail.com>",