/** * BSP layout DSL parser and serializer. * * Syntax: * layout = node * node = split | leaf * split = ("line" | "col" | "tabs") "(" entries ")" * entries = entry ("," entry)* * entry = [label ":"] node [weight] ["=" command] ["@" fontSize] * label = identifier | quoted-string * leaf = identifier | quoted-string * command = identifier | quoted-string * weight = number * fontSize = number ["px" | "pt" | "%"] * identifier = [a-zA-Z_][a-zA-Z0-9_-]* * * Examples: * shell * line(chat 2, col(shell, tail, htop)) * line(editor 3 @14, col(shell @11, logs)) * tabs(shell, htop, logs) * tabs("Editor": col(a, b), "Terminal": col(c, d)) * line(editor 2, tabs(shell, logs)) * col(htop="htop", shell="cd /src && make watch") */ export type BSPNode = BSPSplit | BSPLeaf; export interface BSPSplit { type: "split"; direction: "horizontal" | "vertical" | "tabs"; children: BSPChild[]; } export interface BSPChild { node: BSPNode; weight: number; label?: string; } export interface BSPLeaf { type: "leaf"; tag: string; /** Shell command to run when the pane is created. */ command?: string; /** Raw font size, e.g. 14, "12px", "13pt", "80%" */ fontSize?: number | string; } export declare class DSLParseError extends Error { readonly offset: number; constructor(message: string, offset: number); } export declare function parseDSL(input: string): { root: BSPNode; weight: number; }; export declare function serializeDSL(root: BSPNode, weight?: number): string; export declare function collectTags(node: BSPNode): string[]; export declare function leafCount(node: BSPNode): number; //# sourceMappingURL=dsl.d.ts.map