Skip to content

Commit c2adb54

Browse files
committed
explicitply provide typescript typings
Signed-off-by: Chang Wang <[email protected]>
1 parent f19f92f commit c2adb54

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

wasm/src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl TryFrom<Options> for rust_inline::InlineOptions<'_> {
7676
}
7777
}
7878

79-
#[wasm_bindgen]
79+
#[wasm_bindgen(skip_typescript)]
8080
pub fn inline(
8181
html: &str,
8282
options: &JsValue,
@@ -89,3 +89,16 @@ pub fn inline(
8989
let inliner = rust_inline::CSSInliner::new(options.try_into()?);
9090
Ok(inliner.inline(html).map_err(InlineErrorWrapper)?)
9191
}
92+
93+
#[wasm_bindgen(typescript_custom_section)]
94+
const INLINE: &'static str = r#"
95+
interface InlineOptions {
96+
inline_style_tags?: boolean,
97+
remove_style_tags?: boolean,
98+
base_url?: string,
99+
load_remote_stylesheets?: boolean,
100+
extra_css?: string,
101+
}
102+
103+
export function inline(html: string, options?: InlineOptions): string;
104+
"#;

0 commit comments

Comments
 (0)