diff --git a/crates/macro/src/parser/mod.rs b/crates/macro/src/parser/mod.rs index 53947c19..a331ea41 100644 --- a/crates/macro/src/parser/mod.rs +++ b/crates/macro/src/parser/mod.rs @@ -816,7 +816,7 @@ impl ConvertToAST for syn::ItemImpl { let struct_name = extract_path_ident(struct_name)?; - let mut struct_js_name = struct_name.to_string(); + let mut struct_js_name = struct_name.to_string().to_case(Case::UpperCamel); let mut items = vec![]; let mut task_output_type = None; for item in self.items.iter_mut() { diff --git a/examples/napi/__test__/typegen.spec.ts.md b/examples/napi/__test__/typegen.spec.ts.md index 5f236e26..30492b9a 100644 --- a/examples/napi/__test__/typegen.spec.ts.md +++ b/examples/napi/__test__/typegen.spec.ts.md @@ -217,7 +217,7 @@ Generated by [AVA](https://avajs.dev). export type Blake2bHasher = Blake2BHasher␊ /** Smoking test for type generation */␊ export class Blake2BHasher {␊ - static withKey(key: Blake2bKey): Blake2BHasher␊ + update(data: Buffer): void␊ }␊ export type Blake2bKey = Blake2BKey␊ export class Blake2BKey { }␊ diff --git a/examples/napi/__test__/typegen.spec.ts.snap b/examples/napi/__test__/typegen.spec.ts.snap index b96a5c92..00747f19 100644 Binary files a/examples/napi/__test__/typegen.spec.ts.snap and b/examples/napi/__test__/typegen.spec.ts.snap differ diff --git a/examples/napi/index.d.ts b/examples/napi/index.d.ts index 50da5905..909980ed 100644 --- a/examples/napi/index.d.ts +++ b/examples/napi/index.d.ts @@ -207,7 +207,7 @@ export class Bird { export type Blake2bHasher = Blake2BHasher /** Smoking test for type generation */ export class Blake2BHasher { - static withKey(key: Blake2bKey): Blake2BHasher + update(data: Buffer): void } export type Blake2bKey = Blake2BKey export class Blake2BKey { }