histoire
Version:
A fast story book powered by Vite
29 lines • 1.53 kB
TypeScript
import type { HistoireJsonValue } from '@histoire/protocol';
import type { ConfigMode, Plugin } from '@histoire/shared';
import type { BrowserEntryResolver } from './browser-entries.js';
/** Validated `Plugin.workbench` descriptor with entries resolved to files. */
export interface ResolvedWorkbenchPlugin {
/** Descriptor id shared by Node, workbench and frame modules. */
id: string;
/** Extension contract version. */
apiVersion: 1;
/** Validated JSON options, the only plugin data that reaches the browser. */
options: HistoireJsonValue | undefined;
/** Whether both entries are left out of static builds. */
devOnly: boolean;
/** Absolute file of the workbench (`client`) entry. */
client?: string;
/** Absolute file of the frame entry. */
frame?: string;
}
/**
* Validates every `Plugin.workbench` descriptor and resolves its entries, in config order.
* Plugins without a descriptor are skipped. In build mode dev-only descriptors are still
* validated but not resolved, so a dev-only dependency may be absent from build installs.
* @param plugins Resolved Histoire plugins, in config order.
* @param resolveEntry Shared browser entry resolver.
* @param mode Context mode.
* @throws {PluginBrowserConfigError} Attributed to the plugin and field at fault.
*/
export declare function resolveWorkbenchPlugins(plugins: Plugin[], resolveEntry: BrowserEntryResolver, mode: ConfigMode): Promise<ResolvedWorkbenchPlugin[]>;
//# sourceMappingURL=workbench-plugins.d.ts.map