diff --git a/docx-wasm/pkg/index.d.ts b/docx-wasm/pkg/index.d.ts index 24b496b..a56b8da 100644 --- a/docx-wasm/pkg/index.d.ts +++ b/docx-wasm/pkg/index.d.ts @@ -311,6 +311,10 @@ export class Run { * @returns {Run} */ underline(line_type: string): Run; +/** +* @returns {Run} +*/ + vanish(): Run; } /** */ diff --git a/docx-wasm/pkg/index.js b/docx-wasm/pkg/index.js index 0b83719..69302c5 100644 --- a/docx-wasm/pkg/index.js +++ b/docx-wasm/pkg/index.js @@ -883,6 +883,17 @@ export class Run { const ret = wasm.run_underline(ptr, passStringToWasm(line_type), WASM_VECTOR_LEN); return Run.__wrap(ret); } + /** + * @returns {Run} + */ + vanish() { + if (this.ptr == 0) throw new Error('Attempt to use a moved value'); + const ptr = this.ptr; + this.ptr = 0; + _assertNum(ptr); + const ret = wasm.run_vanish(ptr); + return Run.__wrap(ret); + } } /** */ diff --git a/docx-wasm/pkg/index_bg.d.ts b/docx-wasm/pkg/index_bg.d.ts index 4d83aa9..348bce1 100644 --- a/docx-wasm/pkg/index_bg.d.ts +++ b/docx-wasm/pkg/index_bg.d.ts @@ -12,6 +12,7 @@ export function run_highlight(a: number, b: number, c: number): number; export function run_bold(a: number): number; export function run_italic(a: number): number; export function run_underline(a: number, b: number, c: number): number; +export function run_vanish(a: number): number; export function __wbg_comment_free(a: number): void; export function createComment(a: number): number; export function comment_author(a: number, b: number, c: number): number; diff --git a/docx-wasm/pkg/index_bg.wasm b/docx-wasm/pkg/index_bg.wasm index e2e1a22..0f39fa8 100644 Binary files a/docx-wasm/pkg/index_bg.wasm and b/docx-wasm/pkg/index_bg.wasm differ diff --git a/docx-wasm/src/run.rs b/docx-wasm/src/run.rs index ec0c0ad..8160933 100644 --- a/docx-wasm/src/run.rs +++ b/docx-wasm/src/run.rs @@ -70,6 +70,11 @@ impl Run { self.0.run_property = self.0.run_property.underline(line_type); self } + + pub fn vanish(mut self) -> Run { + self.0.run_property = self.0.run_property.vanish(); + self + } } impl Run {