@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
53 lines • 1.55 kB
TypeScript
import type { ServerStoryFile, StoryContext } from './types';
/**
* Render a story component with props
*/
export declare function renderStoryComponent(ctx: StoryContext, componentPath: string, options?: StoryRenderOptions): Promise<StoryRenderResult>;
/**
* Render a story variant
*/
export declare function renderStoryVariant(ctx: StoryContext, story: ServerStoryFile, variantId: string, props?: Record<string, any>): Promise<StoryRenderResult>;
/**
* Render an inline template string
*/
export declare function renderInlineTemplate(ctx: StoryContext, template: string, props?: Record<string, any>): Promise<StoryRenderResult>;
/**
* Clear the story component cache
*/
export declare function clearStoryCache(): void;
/**
* Get cache statistics
*/
export declare function getCacheStats(): { size: number, entries: string[] };
/**
* Preload components into cache
*/
export declare function preloadComponents(paths: string[]): Promise<number>;
/**
* Generate preview HTML document
*/
export declare function generatePreviewDocument(result: StoryRenderResult, options?: {
title?: string
theme?: 'light' | 'dark'
background?: string
crosswindCss?: string
}): string;
/**
* Story render options
*/
export declare interface StoryRenderOptions {
props?: Record<string, any>
slots?: Record<string, string>
includeStyles?: boolean
includeCrosswind?: boolean
}
/**
* Story render result
*/
export declare interface StoryRenderResult {
html: string
css: string
js: string
errors: string[]
duration: number
}