@@ -286,7 +286,8 @@ function generateDeclarationFile(items, organizedData) {
286
286
params : ( entry . params || [ ] ) . map ( param => ( {
287
287
name : param . name ,
288
288
type : generateTypeFromTag ( param ) ,
289
- optional : param . type ?. type === 'OptionalType'
289
+ optional : param . type ?. type === 'OptionalType' ,
290
+ rest : param . type ?. type === 'RestType'
290
291
} ) ) ,
291
292
module,
292
293
submodule,
@@ -307,7 +308,8 @@ function generateDeclarationFile(items, organizedData) {
307
308
params : ( entry . params || [ ] ) . map ( param => ( {
308
309
name : param . name ,
309
310
type : generateTypeFromTag ( param ) ,
310
- optional : param . type ?. type === 'OptionalType'
311
+ optional : param . type ?. type === 'OptionalType' ,
312
+ rest : param . type ?. type === 'RestType'
311
313
} ) ) ,
312
314
returnType : entry . returns ?. [ 0 ] ? generateTypeFromTag ( entry . returns [ 0 ] ) : 'void' ,
313
315
module,
@@ -423,7 +425,7 @@ export function generateTypeFromTag(param) {
423
425
424
426
let type = param . type ;
425
427
let prefix = '' ;
426
- const isOptional = param . type ?. type === 'OptionalType' ;
428
+ const isOptional = param . optional || param . type ?. type === 'OptionalType' ;
427
429
if ( typeof type === 'string' ) {
428
430
type = normalizeTypeName ( type ) ;
429
431
} else if ( param . type ?. type ) {
@@ -432,7 +434,7 @@ export function generateTypeFromTag(param) {
432
434
type = 'any' ;
433
435
}
434
436
435
- if ( param . type ?. type === 'RestType' ) {
437
+ if ( param . rest || param . type ?. type === 'RestType' ) {
436
438
prefix = '...' ;
437
439
}
438
440
0 commit comments