@@ -295,6 +295,7 @@ export const genMethodString = (
295
295
moduleMethod : MethodDocumentationBlock ,
296
296
includeType = true ,
297
297
paramTypePrefix = '' ,
298
+ topLevelModuleMethod ?: MethodDocumentationBlock ,
298
299
) : string => {
299
300
const createMethodObjectParamType = (
300
301
objectParam : DetailedObjectType & TypeInformation & DocumentationBlock & { required : boolean } ,
@@ -304,7 +305,7 @@ export const genMethodString = (
304
305
}
305
306
if ( objectParam . name === 'options' ) {
306
307
if (
307
- [ 'show' , 'hide' , 'open' , 'close' , 'start' , 'stop' , 'constructor' ] . includes (
308
+ [ 'show' , 'hide' , 'open' , 'close' , 'start' , 'stop' , 'constructor' , 'print' ] . includes (
308
309
moduleMethod . name . toLowerCase ( ) ,
309
310
)
310
311
) {
@@ -317,7 +318,18 @@ export const genMethodString = (
317
318
return paramInterfaces . createParamInterface ( objectParam , _ . upperFirst ( moduleMethod . name ) ) ;
318
319
}
319
320
320
- return paramInterfaces . createParamInterface ( objectParam , '' , _ . upperFirst ( moduleMethod . name ) ) ;
321
+ if (
322
+ [ 'set' , 'get' ] . includes (
323
+ moduleMethod . name . toLowerCase ( ) ,
324
+ )
325
+ ) {
326
+ return paramInterfaces . createParamInterface (
327
+ objectParam ,
328
+ _ . upperFirst ( module . name ) + _ . upperFirst ( moduleMethod . name ) ,
329
+ ) ;
330
+ }
331
+
332
+ return paramInterfaces . createParamInterface ( objectParam , '' , _ . upperFirst ( moduleMethod . name ) , topLevelModuleMethod ? _ . upperFirst ( topLevelModuleMethod . name ) : '' ) ;
321
333
} ;
322
334
return `${ includeType ? '(' : '' } ${ ( moduleMethod . parameters || [ ] )
323
335
. map ( param => {
@@ -346,6 +358,9 @@ export const genMethodString = (
346
358
name : _ . upperFirst ( moduleMethod . name ) + _ . upperFirst ( param . name ) ,
347
359
...functionParam ,
348
360
} as any /* FIXME: */ ,
361
+ true ,
362
+ '' ,
363
+ moduleMethod
349
364
) ,
350
365
} ) ;
351
366
} else if ( paramType . type === 'Object' && objectParam . properties ) {
@@ -359,7 +374,9 @@ export const genMethodString = (
359
374
}
360
375
const functionParam = param as DetailedFunctionType ;
361
376
if ( param . type === 'Function' && functionParam . parameters ) {
362
- paramType = genMethodString ( paramInterfaces , module , functionParam as any /* FIXME: */ ) ;
377
+ paramType = genMethodString ( paramInterfaces , module , functionParam as any /* FIXME: */ , true ,
378
+ '' ,
379
+ moduleMethod ) ;
363
380
}
364
381
365
382
const name = paramify ( param . name ) ;
0 commit comments