import fs from "fs";
export function storybookOutputTarget(opts) {
    return {
        type: 'docs-custom',
        generator: (docs) => {
            const content = {};
            docs.components.forEach(cmp => {
                content[cmp.tag] = {
                    dependencies: cmp.dependencies,
                    props: cmp.props,
                    methods: cmp.methods,
                    events: cmp.events,
                    slots: cmp.slots,
                };
            });
            return new Promise(resolve => {
                fs.writeFile(opts.file, JSON.stringify(content, null, 2), () => {
                    resolve();
                });
            });
        }
    };
}
