UNPKG

@stacksjs/stx

Version:

A performant UI Framework. Powered by Bun.

35 lines 915 B
/** * Generate hot swap client script * Injects into the story UI for seamless variant switching */ export declare function getHotSwapScript(): string; /** * Generate variant selector UI */ export declare function getVariantSelectorHtml(variants: Array<{ id: string, title: string }>, currentVariantId: string): string; /** * Generate variant selector styles */ export declare function getVariantSelectorStyles(): string; /** * STX Story - Hot Swap * Switch story variants without full page reload */ /** * Hot swap state */ export declare interface HotSwapState { storyId: string | null variantId: string | null props: Record<string, any> iframe: HTMLIFrameElement | null } /** * Hot swap options */ export declare interface HotSwapOptions { animationDuration?: number preserveScroll?: boolean onBeforeSwap?: (state: HotSwapState) => void onAfterSwap?: (state: HotSwapState) => void }