import React, { type PropsWithChildren } from 'react'; import { type ComposableProps } from '@dxos/ui-types'; import { type JsonReplacer } from '../JsonHighlighter/index.ts'; export type SyntaxContextValue = { mode: 'text' | 'json'; source?: string; language?: string; data?: any; filteredData?: any; filterText: string; setFilterText: (text: string) => void; filterError: Error | null; replacer?: JsonReplacer; depth: number; setDepth: (depth: number) => void; }; type SyntaxRootProps = PropsWithChildren<{ language?: string; source?: string; data?: any; /** * `JSON.stringify` replacer applied to `data`. Use the function form to follow domain * references (e.g. ECHO refs) by returning a transformed value at the root call. Keeps * this package free of any domain-specific knowledge. */ replacer?: JsonReplacer; /** * Depth-parametrized replacer, re-evaluated as the `Syntax.Depth` control changes. Takes * precedence over `replacer`. The consumer owns any domain knowledge (e.g. how depth maps to * ref resolution), so this package stays domain-free. */ getReplacer?: (depth: number) => JsonReplacer | undefined; /** Initial expansion depth for `Syntax.Depth` / `getReplacer`. */ defaultDepth?: number; /** Notified when the depth changes (via `Syntax.Depth`). */ onDepthChange?: (depth: number) => void; }>; /** * Headless context provider. Selects JSON mode when the `data` prop is passed at all — even * `data={undefined}` — so loading states render an empty JSON view rather than flipping to * text mode (which would trip `Syntax.Filter`'s JSON-only guard). Mode is chosen by prop * presence, not value. */ declare const SyntaxRoot: { (props: SyntaxRootProps): React.JSX.Element; displayName: string; }; type SyntaxContentProps = ComposableProps; type SyntaxFilterProps = ComposableProps<{ placeholder?: string; }>; type SyntaxDepthProps = ComposableProps; type SyntaxViewportProps = ComposableProps; type SyntaxCodeProps = ComposableProps<{ testId?: string; }>; export declare const Syntax: { Root: typeof SyntaxRoot; Content: React.ForwardRefExoticComponent & { classNames?: import("@dxos/ui-types").ClassNameValue; } & Pick, "children" | "role" | "style"> & React.RefAttributes>; Filter: React.ForwardRefExoticComponent & { classNames?: import("@dxos/ui-types").ClassNameValue; } & Pick, "children" | "role" | "style"> & React.RefAttributes>; Depth: React.ForwardRefExoticComponent & { classNames?: import("@dxos/ui-types").ClassNameValue; } & Pick, "children" | "role" | "style"> & React.RefAttributes>; Viewport: React.ForwardRefExoticComponent & { classNames?: import("@dxos/ui-types").ClassNameValue; } & Pick, "children" | "role" | "style"> & React.RefAttributes>; Code: React.ForwardRefExoticComponent & { classNames?: import("@dxos/ui-types").ClassNameValue; } & Pick, "children" | "role" | "style"> & React.RefAttributes>; }; export type { SyntaxCodeProps, SyntaxContentProps, SyntaxDepthProps, SyntaxFilterProps, SyntaxRootProps, SyntaxViewportProps, }; //# sourceMappingURL=Syntax.d.ts.map