fix(cli): generated type def on multi impl blocks

This commit is contained in:
LongYinan 2022-04-26 17:53:54 +08:00
parent cc79c9794e
commit c3a35a0704
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
4 changed files with 7 additions and 1 deletions

View file

@ -592,7 +592,11 @@ async function processIntermediateTypeFile(
}) })
break break
case 'impl': 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 break
case 'interface': case 'interface':
dts += dts +=

View file

@ -217,6 +217,7 @@ Generated by [AVA](https://avajs.dev).
export type Blake2bHasher = Blake2BHasher␊ export type Blake2bHasher = Blake2BHasher␊
/** Smoking test for type generation */␊ /** Smoking test for type generation */␊
export class Blake2BHasher {␊ export class Blake2BHasher {␊
static withKey(key: Blake2bKey): Blake2BHasher␊
update(data: Buffer): void␊ update(data: Buffer): void␊
}␊ }␊
export type Blake2bKey = Blake2BKey␊ export type Blake2bKey = Blake2BKey␊

View file

@ -207,6 +207,7 @@ export class Bird {
export type Blake2bHasher = Blake2BHasher export type Blake2bHasher = Blake2BHasher
/** Smoking test for type generation */ /** Smoking test for type generation */
export class Blake2BHasher { export class Blake2BHasher {
static withKey(key: Blake2bKey): Blake2BHasher
update(data: Buffer): void update(data: Buffer): void
} }
export type Blake2bKey = Blake2BKey export type Blake2bKey = Blake2BKey