feat: Add vanish for wasm (#9)

main
bokuweb 2019-12-14 01:08:23 +09:00 committed by GitHub
parent 4447ab6e9d
commit c6a9665621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 0 deletions

View File

@ -311,6 +311,10 @@ export class Run {
* @returns {Run}
*/
underline(line_type: string): Run;
/**
* @returns {Run}
*/
vanish(): Run;
}
/**
*/

View File

@ -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);
}
}
/**
*/

View File

@ -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;

Binary file not shown.

View File

@ -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 {