@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
17 lines • 693 B
TypeScript
import type { ResolvedStoryConfig, ServerStoryFile, ServerTree, ServerTreeLeaf, } from '../types';
/**
* Create tree path from a story file
*/
export declare function createTreePath(config: ResolvedStoryConfig, file: ServerStoryFile): string[];
/**
* Build the navigation tree from story files
*/
export declare function buildTree(config: ResolvedStoryConfig, files: ServerStoryFile[]): ServerTree;
/**
* Flatten tree to get all leaf indices in order
*/
export declare function flattenTree(tree: ServerTree): number[];
/**
* Find a story in the tree by index
*/
export declare function findStoryInTree(tree: ServerTree, index: number): { path: string[], node: ServerTreeLeaf } | null;