@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
42 lines • 1.29 kB
TypeScript
import type { AnalyzedComponent, ServerStoryFile } from '../types';
/**
* Generate code panel HTML
*/
export declare function generateCodePanel(story: ServerStoryFile, component: AnalyzedComponent | null, activeTab?: CodePanelTab): string;
/**
* Get source code for a component
*/
export declare function getComponentSource(filePath: string): Promise<string>;
/**
* Get story code with current props
*/
export declare function getStoryCode(componentName: string, props: Record<string, any>): string;
/**
* Get props as JSON
*/
export declare function getPropsJson(props: Record<string, any>): string;
/**
* Apply syntax highlighting to code
* Uses simple regex-based highlighting without external deps
*/
export declare function highlightCode(code: string, language: string): string;
/**
* Get syntax highlighting styles
*/
export declare function getHighlightStyles(): string;
/**
* Get code panel styles
*/
export declare function getCodePanelStyles(): string;
/**
* Copy code to clipboard (client-side)
*/
export declare function getCopyCodeScript(): string;
/**
* Open in VS Code (client-side)
*/
export declare function getOpenInVSCodeScript(filePath: string): string;
/**
* Code panel tabs
*/
export type CodePanelTab = 'source' | 'story' | 'compiled' | 'props'