storybook
Version:
Storybook: Develop, document, and test UI components in isolation
63 lines (59 loc) • 1.92 kB
TypeScript
declare const ADDON_ID = "storybook/background";
declare const PARAM_KEY = "backgrounds";
declare const GRID_PARAM_KEY = "grid";
declare const EVENTS: {
UPDATE: string;
};
interface Background {
name: string;
value: string;
}
type BackgroundMap = Record<string, Background>;
interface GridConfig {
cellAmount: number;
cellSize: number;
opacity: number;
offsetX?: number;
offsetY?: number;
}
type GlobalState = {
value: string | undefined;
grid?: boolean;
};
type GlobalStateUpdate = Partial<GlobalState>;
interface BackgroundsParameters {
/**
* Backgrounds configuration
*
* @see https://storybook.js.org/docs/essentials/backgrounds#parameters
*/
backgrounds?: {
/** Default background color */
default?: string;
/**
* Removes the tool and disables the feature's behavior. If you wish to turn off this feature
* for the entire Storybook, you can set the option in your `main.js|ts` configuration file.
*
* @see https://storybook.js.org/docs/essentials/backgrounds#disable
*/
disable?: boolean;
/** Configuration for the background grid */
grid?: GridConfig;
/** Available background colors */
options?: BackgroundMap;
};
}
interface BackgroundsGlobals {
/**
* Backgrounds configuration
*
* @see https://storybook.js.org/docs/essentials/backgrounds#globals
*/
[PARAM_KEY]?: GlobalState | GlobalState['value'];
}
interface BackgroundTypes {
parameters: BackgroundsParameters;
globals: BackgroundsGlobals;
}
declare const DEFAULT_BACKGROUNDS: BackgroundMap;
export { ADDON_ID, type Background, type BackgroundMap, type BackgroundTypes, type BackgroundsGlobals, type BackgroundsParameters, DEFAULT_BACKGROUNDS, EVENTS, GRID_PARAM_KEY, type GlobalState, type GlobalStateUpdate, type GridConfig, PARAM_KEY };