diff --git a/cli/src/build.ts b/cli/src/build.ts index 6ac79586..1cfc33c0 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -592,7 +592,11 @@ async function processIntermediateTypeFile( }) break case 'impl': - impls.set(def.name, `${def.js_doc}${def.def}`) + const existed = impls.get(def.name) + impls.set( + def.name, + `${existed ? existed + '\n' : ''}${def.js_doc}${def.def}`, + ) break case 'interface': dts += diff --git a/examples/napi/__test__/typegen.spec.ts.md b/examples/napi/__test__/typegen.spec.ts.md index 30492b9a..a1ef7ede 100644 --- a/examples/napi/__test__/typegen.spec.ts.md +++ b/examples/napi/__test__/typegen.spec.ts.md @@ -217,6 +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␊ diff --git a/examples/napi/__test__/typegen.spec.ts.snap b/examples/napi/__test__/typegen.spec.ts.snap index 00747f19..2fedede7 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 909980ed..12fdd1a9 100644 --- a/examples/napi/index.d.ts +++ b/examples/napi/index.d.ts @@ -207,6 +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