@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
47 lines • 1.24 kB
TypeScript
import type { StoryContext } from './types';
/**
* Load and execute the setup file
*/
export declare function loadSetupFile(ctx: StoryContext): Promise<void>;
/**
* Get all registered global components
*/
export declare function getGlobalComponents(): Map<string, any>;
/**
* Get all global CSS
*/
export declare function getGlobalCSS(): string;
/**
* Get all global scripts
*/
export declare function getGlobalScripts(): string;
/**
* Get global state
*/
export declare function getGlobalState(): Map<string, any>;
/**
* Get a specific global state value
*/
export declare function getState<T = any>(key: string): T | undefined;
/**
* Reset all global setup (for testing)
*/
export declare function resetSetup(): void;
/**
* Generate HTML for global setup (CSS + scripts)
*/
export declare function getSetupHTML(): string;
/**
* Context passed to setup function
*/
export declare interface SetupContext {
storyContext: StoryContext
registerComponent: (name: string, component: any) => void
addCSS: (css: string) => void
addScript: (script: string) => void
setState: (key: string, value: any) => void
}
/**
* Setup function signature
*/
export type SetupFunction = (ctx: SetupContext) => void | Promise<void>