diff --git a/build/api/build-methods.js b/build/api/build-methods.js index ca0a6c67..71a58588 100644 --- a/build/api/build-methods.js +++ b/build/api/build-methods.js @@ -51,6 +51,13 @@ const buildMethods = async ( } return `object`; } + + if (typeObj.type === 'array') { + if (typeObj && typeObj.elementType && typeObj.elementType.name) { + return `${typeObj.elementType.name}[]`; + } + } + return typeObj.name || ''; }; @@ -153,6 +160,7 @@ export const ${typesName} = () => { ` : '' } + ${methods .map( (item) => ` diff --git a/build/api/build-options.js b/build/api/build-options.js index 3f256eb0..a427e578 100644 --- a/build/api/build-options.js +++ b/build/api/build-options.js @@ -48,12 +48,21 @@ const buildOptions = async ( if (typeObj.type === 'reflection') { if (typeObj && typeObj.declaration && typeObj.declaration.signatures) { const args = (typeObj.declaration.signatures[0].parameters || []) - .map((param) => `${param.name}`) + .map( + (param) => + `${param.name}` + ) .join(', '); return `function(${args || ''})`; } return `object`; } + + if (typeObj.type === 'array') { + if (typeObj && typeObj.elementType && typeObj.elementType.name) { + return `${typeObj.elementType.name}[]`; + } + } if (item.name === 'onAny') { return 'function'; }