diff --git a/src/module-declaration.ts b/src/module-declaration.ts index 07e2558..e095708 100644 --- a/src/module-declaration.ts +++ b/src/module-declaration.ts @@ -185,7 +185,7 @@ export const generateModuleDeclaration = ( listener = `(${args.join(`,\n${indent}`)}) => void`; } - for (let method of ['on', 'once', 'addListener', 'removeListener']) { + for (let method of ['on', 'off', 'once', 'addListener', 'removeListener']) { moduleAPI.push(`${method}(event: '${moduleEvent.name}', listener: ${listener}): this;`); } }); @@ -251,7 +251,7 @@ export const generateModuleDeclaration = ( } const returnsThis = (moduleMethod: Pick) => - ['on', 'once', 'removeAllListeners', 'removeListener'].includes(moduleMethod.name); + ['on', 'off', 'once', 'addListener', 'removeAllListeners', 'removeListener'].includes(moduleMethod.name); const addMethod = (moduleMethod: MethodDocumentationBlock, prefix = '') => { utils.extendArray(