import { type ID, type RendererState, type VNode } from "./protocol.js"; import type { ReactLynxFindMatch } from "./types.js"; export interface FormattedReactLynxTree { text: string; /** `labels[index]` is the vnode id represented by `@c${index + 1}`. */ labels: ID[]; } export interface ReactLynxTreeState { roots: ID[]; nodes: VNode[]; } export type ReactLynxLinkRef = { kind: "element"; ref: string; } | { kind: "component-label"; index: number; } | { kind: "component-id"; id: ID; }; /** Assign canonical `@cN` labels and render the matching compact tree. */ export declare function formatReactLynxTree(state: RendererState, options?: { maxDepth?: number; hideShells?: boolean; }): FormattedReactLynxTree; /** Copy a mutable renderer tree into an HTTP/JSON-safe representation. */ export declare function serializeRendererState(state: RendererState): ReactLynxTreeState; /** Rebuild a renderer tree at the CLI edge without sharing daemon state. */ export declare function deserializeRendererState(value: ReactLynxTreeState): RendererState; export declare function buildSubstringMatcher(pattern: string): (name: string) => boolean; export declare function buildRegexMatcher(pattern: string): (name: string) => boolean; /** Find components in the exact label order used by the tree renderer. */ export declare function findReactLynxComponents(state: RendererState, matcher: (name: string) => boolean, options: { hideShells: boolean; limit: number; formatted?: FormattedReactLynxTree; }): ReactLynxFindMatch[]; export declare function parseReactLynxComponentRef(ref: string): { kind: "label"; index: number; } | { kind: "id"; id: ID; }; export declare function parseReactLynxLinkRef(ref: string): ReactLynxLinkRef; /** Add the sentinel segment discarded by the app-side Preact adapter. */ export declare function buildReactLynxUpdatePath(userPath: string): string;