@@ -295,6 +295,7 @@ export const genMethodString = (
295295 moduleMethod : MethodDocumentationBlock ,
296296 includeType = true ,
297297 paramTypePrefix = '' ,
298+ topLevelModuleMethod ?: MethodDocumentationBlock ,
298299) : string => {
299300 const createMethodObjectParamType = (
300301 objectParam : DetailedObjectType & TypeInformation & DocumentationBlock & { required : boolean } ,
@@ -304,7 +305,7 @@ export const genMethodString = (
304305 }
305306 if ( objectParam . name === 'options' ) {
306307 if (
307- [ 'show' , 'hide' , 'open' , 'close' , 'start' , 'stop' , 'constructor' ] . includes (
308+ [ 'show' , 'hide' , 'open' , 'close' , 'start' , 'stop' , 'constructor' , 'print' ] . includes (
308309 moduleMethod . name . toLowerCase ( ) ,
309310 )
310311 ) {
@@ -317,7 +318,18 @@ export const genMethodString = (
317318 return paramInterfaces . createParamInterface ( objectParam , _ . upperFirst ( moduleMethod . name ) ) ;
318319 }
319320
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 ) : '' ) ;
321333 } ;
322334 return `${ includeType ? '(' : '' } ${ ( moduleMethod . parameters || [ ] )
323335 . map ( param => {
@@ -346,6 +358,9 @@ export const genMethodString = (
346358 name : _ . upperFirst ( moduleMethod . name ) + _ . upperFirst ( param . name ) ,
347359 ...functionParam ,
348360 } as any /* FIXME: */ ,
361+ true ,
362+ '' ,
363+ moduleMethod
349364 ) ,
350365 } ) ;
351366 } else if ( paramType . type === 'Object' && objectParam . properties ) {
@@ -359,7 +374,9 @@ export const genMethodString = (
359374 }
360375 const functionParam = param as DetailedFunctionType ;
361376 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 ) ;
363380 }
364381
365382 const name = paramify ( param . name ) ;
0 commit comments