Skip to content

Commit b2270b2

Browse files
author
skidy89
committed
format
1 parent 04a26cc commit b2270b2

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

__test__/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test('load languages', (t) => {
77
t.is(e.e.hello, 'hello world')
88
})
99
test("generate typescript definitions", (t) => {
10-
generateTypescriptDefs("__test__/", "__test__/languages.d.ts")
10+
generateTypescriptDefs("__test__/", "__test__/languages.d.ts", true)
1111
t.pass()
1212
})
1313

__test__/languages.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface Lang {
1313
/** hello world */
1414
'hello': string;
1515
/** This is a {placeholder} test. */
16-
'test_placeholder': string;
16+
'test_placeholder': (args: { placeholder: string }) => string;
1717
/**
1818
* [
1919
* "key1",

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ fn to_js<'a>(env: &'a Env, langs: &LangCache) -> Result<Object<'a>> {
203203
Ok(root)
204204
}
205205
#[napi]
206-
pub fn generate_typescript_defs(dir: String, output: String, gen_placeholder: Option<bool>) -> Result<()> {
206+
pub fn generate_typescript_defs(
207+
dir: String,
208+
output: String,
209+
gen_placeholder: Option<bool>,
210+
) -> Result<()> {
207211
let langs = load_lang_dsk(&dir)?;
208212
let mut defs = String::new();
209213
defs.push_str("// THIS FILE WAS GENERATED BY SSL\n");

0 commit comments

Comments
 (0)