From 80fe9e0eaaefcb754a8cb604e232d387a92ec09e Mon Sep 17 00:00:00 2001 From: Maksim Nedoshev Date: Wed, 19 Apr 2023 17:49:06 +0300 Subject: [PATCH] fix(docs): parse methods --- .../modules/page-config/blocks/api/transform.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/docs/modules/page-config/blocks/api/transform.ts b/packages/docs/modules/page-config/blocks/api/transform.ts index 1b1bb1dd276..3879aadd2ac 100644 --- a/packages/docs/modules/page-config/blocks/api/transform.ts +++ b/packages/docs/modules/page-config/blocks/api/transform.ts @@ -52,14 +52,23 @@ const stringifyMeta = (meta: ComponentMeta) => { types: slot.type }) }), {}), - emits: meta.events.reduce((acc, event) => ({ + events: meta.events.reduce((acc, event) => ({ ...acc, [event.name]: ({ types: event, }) }), {}), methods: {}, - }) + // TODO: We need to use exposed in components before we can use this + // methods: meta.exposed + // .filter((method) => /^\(.*\)\s?=>.*$/.test(method.type)) + // .reduce((acc, method) => ({ + // ...acc, + // [method.name]: ({ + // types: method.type, + // }), + // }), {}) + // }) } export default defineBlockTransform(async function (block) {