import { Node, ParseError } from "jsonc-parser"; /** A character-offset span into the source text (end-exclusive). */ export interface OffsetRange { start: number; end: number; } /** Result of parsing: the CST root (if any) plus lenient syntax errors. */ export interface JsonParse { root: Node | undefined; errors: ParseError[]; } /** * Parse JSON(-with-comments) into a position-preserving CST. jsonc-parser is * tolerant of the half-typed, comma-trailing states an editor streams, and * collects syntax errors rather than throwing. */ export declare function parseJsonTree(text: string): JsonParse; /** * Turn an AJV `instancePath` (`/tests/0/steps/1/goTo`) into path segments, * decoding the JSON-Pointer escapes (`~1`→`/`, `~0`→`~`) and numeric indices. */ export declare function instancePathToSegments(instancePath: string): Array; /** * Resolve the source span for an AJV `instancePath`. When the exact node is * absent (e.g. a `required` error names an object whose child doesn't exist), * walks up to the nearest present ancestor so the diagnostic still anchors * somewhere sensible instead of vanishing. Returns `null` only when even the * root can't be located (unparseable input). */ export declare function rangeForInstancePath(root: Node, instancePath: string): OffsetRange | null; /** A step whose author used the `action`-as-value antipattern. */ export interface ActionKeyedStep { /** Span of the offending `"action"` key, for the squiggle. */ keyRange: OffsetRange; /** JSON-Pointer to the step object, used to suppress its `anyOf` noise. */ pointer: string; } /** * Build a JSON-Pointer from path segments, escaping `~`→`~0` and `/`→`~1` per * RFC 6901. Shared by the JSON and YAML action-keyed detectors. */ export declare function pointerFromPath(segments: Array): string; /** * Find every step written as an object carrying an `action` property inside a * `steps` array — the classic Doc Detective mistake (action name as a *value* * under `action`, instead of the compact action-as-key form). Returns the * `"action"` key span (to squiggle) and the step's JSON-Pointer (to suppress * the otherwise-overwhelming `anyOf` schema failures for that same step). */ export declare function findActionKeyedSteps(root: Node): ActionKeyedStep[]; //# sourceMappingURL=positions.d.ts.map