import type { ReadonlyJSONObject } from "./json-value.js";
/** Retained backends must preserve their arguments. */
export type JsonParserBackend = {
    readonly currentArgs: ReadonlyJSONObject;
    append(delta: string): JsonParserBackend | undefined;
};
export type JsonParserBackendContext = {
    readonly text: string;
    readonly fallback: ReadonlyJSONObject;
    /** Detaches mutable values and attaches assistant-stream's partial-field metadata; build every `currentArgs` snapshot with it. */
    readonly createSnapshot: (value: ReadonlyJSONObject, state: "partial" | "complete", partialPath: readonly (string | number)[]) => ReadonlyJSONObject;
};
/** Return undefined for input that cannot preserve the native parser's values and metadata. */
export type JsonParserBackendFactory = (context: JsonParserBackendContext) => JsonParserBackend | undefined;
/**
 * Registers a backend for new shared JSON parsers in this JavaScript realm.
 * The most recent registration takes precedence, including across package copies.
 * The backend must preserve native values, metadata, and independent branches;
 * returning undefined or throwing falls back to native parsing.
 * Unregistering removes only this registration and leaves existing parsers intact.
 */
export declare const registerJsonParserBackend: (factory: JsonParserBackendFactory) => (() => void);
export declare const createJsonParserBackend: (context: JsonParserBackendContext) => JsonParserBackend | undefined;
//# sourceMappingURL=json-parser-backend.d.ts.map