import { CssPartMeta, CssPropMeta, EventMeta, MethodMeta, PropMeta, SlotMeta } from '../ComponentMeta'; import { PluginBuilder } from '../Plugin'; export interface StorybookManifestPluginConfig extends Record { cwd: string; outFile: string; includeExamples: boolean; extendAttribute?(attribute: PropMeta): Partial | undefined; extendProperty?(property: PropMeta): Partial | undefined; extendMethod?(method: MethodMeta): Partial | undefined; extendEvent?(event: EventMeta): Partial | undefined; extendSlot?(slot: SlotMeta): Partial | undefined; extendCssProperty?(cssProp: CssPropMeta): Partial | undefined; extendCssPart?(cssPart: CssPartMeta): Partial | undefined; } export declare const STORYBOOK_MANIFEST_PLUGIN_DEFAULT_CONFIG: StorybookManifestPluginConfig; export declare function normalizeStorybookManifestPluginConfig(config: Partial): Promise; /** * Transforms component metadata into a Storybook manifest file that can be used to * automatically infer arg types. This will run in the `transform` plugin lifecycle step. * * @option cwd - The current working directory, defaults to `process.cwd()`. * @option outFile - Custom path to where the manifest file should be output. * @option includeExamples - Whether any examples should be appended to the component description. * @option extendAttribute - Can be used to extend the JSON output of component attributes. * @option extendProperty - Can be used to extend the JSON output of component properties. * @option extendMethod - Can be used to extend the JSON output of component methods. * @option extendEvent - Can be used to extend the JSON output of component events. * @option extendSlot - Can be used to extend the JSON output of component slots. * @option extendCssProperty - Can be used to extend the JSON output of component CSS properties. * @option extendCssPart - Can be used to extend the JSON output of component CSS parts. * * @example * ```ts * * // wcom.config.ts * * import { storybookManifestPlugin } from '@wcom/cli'; * * export default [ * storybookManifestPlugin({ * // Configuration options here. * outFile: './storybook.json', * }), * ]; * ``` * * ```js * * // .storybook/bootstrap.js * * import { setCustomElements } from '@storybook/web-components'; * import manifest from '../storybook.json'; * * setCustomElements(manifest); * ``` * * ```js * * // .storybook/main.js * * modules.exports = { * stories: ['./bootstrap.js', '...'], * // ... * } * ``` */ export declare const storybookManifestPlugin: PluginBuilder>; /** * Seems like Storybook tests are based on [`web-component-analyzer`](https://github.com/runem/web-component-analyzer), * so it relies on the `custom-elements.json` file that the library outputs which doesn't match the * official schema. * * @link https://github.com/storybookjs/storybook/blob/next/addons/docs/src/frameworks/web-components/custom-elements.ts * @schema https://github.com/webcomponents/custom-elements-manifest */ export interface StorybookManifest { tags: StorybookCustomElement[]; } export interface StorybookCustomElement { name: string; description: string; attributes?: ItemType[]; properties?: ItemType[]; events?: ItemType[]; methods?: ItemType[]; slots?: ItemType[]; cssProperties?: ItemType[]; cssParts?: ItemType[]; } export interface StorybookItem extends Record { name: string; type?: string; description: string; default?: unknown; defaultValue?: unknown; } //# sourceMappingURL=index.d.ts.map