@fredboulanger/ui-skins-storybook
Version:
Generate Storybook ui-skins configuration from *.ui_skins.themes.yml files
43 lines (39 loc) • 1.23 kB
text/typescript
import { Plugin } from 'vite';
interface ThemeConfig {
key: string;
label: string;
value: string;
target: string;
}
interface ThemeGeneratorOptions {
namespaces?: Record<string, string>;
}
/**
* Generate Storybook data-themes.ts configuration from *.ui_skins.themes.yml files
*/
declare function generateThemes(options?: ThemeGeneratorOptions): Promise<void>;
/**
* Generate the themes configuration file
*/
declare function generateThemesConfig(themes: ThemeConfig[]): string;
interface ViteThemeGeneratorOptions {
/**
* Whether to generate themes on build start
* @default true
*/
generateOnStart?: boolean;
/**
* Whether to watch theme files for changes
* @default true
*/
watch?: boolean;
/**
* Namespaces to search for theme files
*/
namespaces?: Record<string, string>;
}
/**
* Vite plugin for automatic theme generation from *.ui_skins.themes.yml files
*/
declare function vitePluginThemeGenerator(options?: ViteThemeGeneratorOptions): Plugin;
export { type ThemeConfig as T, type ViteThemeGeneratorOptions as V, generateThemesConfig as a, type ThemeGeneratorOptions as b, generateThemes as g, vitePluginThemeGenerator as v };