import { OutgoingHttpHeaders } from 'node:http'; import { z } from 'zod'; import { UserConfig, Plugin, Manifest } from 'vite'; export { UserConfig as ViteConfig } from 'vite'; import { FilterPattern } from '@rollup/pluginutils'; declare const BuilderConfigSchema: z.ZodObject<{ base: z.ZodDefault>; cacheDir: z.ZodEffects>, URL, string | undefined>; publicDir: z.ZodEffects>, URL, string | undefined>; root: z.ZodEffects>, URL, string | undefined>; input: z.ZodEffects>, URL, string | undefined>; output: z.ZodDefault>, URL, string | undefined>; client: z.ZodEffects>, URL, string | undefined>; server: z.ZodEffects>, URL, string | undefined>; asset: z.ZodDefault>; assetsPrefix: z.ZodOptional; manifest: z.ZodDefault>; }, "strip", z.ZodTypeAny, { client: URL; server: URL; dir: URL; asset: string; manifest: string; assetsPrefix?: string | undefined; }, { dir?: string | undefined; client?: string | undefined; server?: string | undefined; asset?: string | undefined; assetsPrefix?: string | undefined; manifest?: string | undefined; }>>>; server: z.ZodEffects>>; port: z.ZodDefault>; headers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { host: string | boolean; port: number; headers?: OutgoingHttpHeaders | undefined; }, { host?: string | boolean | undefined; port?: number | undefined; headers?: OutgoingHttpHeaders | undefined; }>>>, { host: string | boolean; port: number; headers?: OutgoingHttpHeaders | undefined; }, unknown>; vite: z.ZodDefault>; }, "strip", z.ZodTypeAny, { server: { host: string | boolean; port: number; headers?: OutgoingHttpHeaders | undefined; }; base: string; cacheDir: URL; publicDir: URL; root: URL; input: URL; output: { client: URL; server: URL; dir: URL; asset: string; manifest: string; assetsPrefix?: string | undefined; }; vite: UserConfig; }, { base?: string | undefined; cacheDir?: string | undefined; publicDir?: string | undefined; root?: string | undefined; input?: string | undefined; output?: { dir?: string | undefined; client?: string | undefined; server?: string | undefined; asset?: string | undefined; assetsPrefix?: string | undefined; manifest?: string | undefined; } | undefined; server?: unknown; vite?: UserConfig | undefined; }>; interface Output { dir?: string; client?: string; server?: string; assets?: string; assetsPrefix?: string; serverEntry?: string; } interface Server { host?: string | boolean; port?: number; headers?: OutgoingHttpHeaders; } interface BuilderUserConfig { base?: string; cacheDir?: string; publicDir?: string; tempDir?: string; root?: string; input?: string; output?: Output; server?: Server | ((options: { command: "dev" | "preview"; }) => Server); vite?: UserConfig; } interface BuilderConfig extends z.output { } type AppendWebWidgetMetaPluginOptions = { manifest: Manifest; include?: FilterPattern; exclude?: FilterPattern; }; declare function appendWebWidgetMetaPlugin({ manifest, include, exclude, }: AppendWebWidgetMetaPluginOptions): Plugin; interface ComponentToWebWidgetPluginOptions { provide: string; inject?: string | string[]; destructuringExportDefault?: boolean | { exclude: string[]; }; include?: FilterPattern; exclude?: FilterPattern; } declare function componentToWebWidgetPlugin({ provide, inject, destructuringExportDefault, include, exclude, }: ComponentToWebWidgetPluginOptions): Plugin; type ViteSsrManifest = Record; type ReplaceAssetPluginOptions = { /** SSR Manifest */ manifest: Manifest | ViteSsrManifest | [Manifest, ViteSsrManifest] | [ViteSsrManifest, Manifest]; include?: FilterPattern; exclude?: FilterPattern; }; /** * Replace the asset's placeholder with the asset's path. */ declare function replaceAssetPlugin({ manifest, include, exclude, }: ReplaceAssetPluginOptions): Plugin; interface WebWidgetToComponentPluginOptions { cache?: Set; provide: string; inject?: string; component?: FilterPattern | { include?: FilterPattern; exclude?: FilterPattern; }; include?: FilterPattern; exclude?: FilterPattern; } /** * Input: * * import MyComponent from "../widgets/my-component.widget.jsx"; * ... * * * Becomes: * * import { defineWebWidget } from "@web-widget/react"; * const MyComponent = defineWebWidget(() => import("../widgets/my-component.widget.jsx"), { * base: import.meta.url, * import: "asset://widgets/my-component.widget.jsx" * }); * ... * */ declare function webWidgetToComponentPlugin({ cache, provide, inject, component, include, exclude, }: WebWidgetToComponentPluginOptions): Plugin; interface WebWidgetPluginOptions { provide?: string; toWebWidgets?: Partial; toComponents?: Partial; } declare function webWidgetPlugin({ provide, toWebWidgets, toComponents, }: WebWidgetPluginOptions): Plugin[]; declare function defineConfig(config: BuilderUserConfig): BuilderUserConfig; export { BuilderConfig, BuilderUserConfig, Output, Server, WebWidgetPluginOptions, appendWebWidgetMetaPlugin, componentToWebWidgetPlugin, defineConfig, replaceAssetPlugin, webWidgetPlugin, webWidgetToComponentPlugin };