/** * Format-preserving JSON modification utilities. * * Detects and preserves existing formatting (indentation, line endings) * when modifying JSON files using jsonc-parser's surgical edit operations. * * @experimental This API is unstable and may change without notice. * @packageDocumentation */ import * as JsonPatch from "effect/JsonPatch"; import type * as Schema from "effect/Schema"; /** * A single JSON modification: set or remove a value at a path. * * @experimental This API is unstable and may change without notice. */ export interface JsonModification { readonly path: ReadonlyArray; readonly value: unknown; } export type JsonPointerPathResult = { readonly _tag: "Success"; readonly path: ReadonlyArray; } | { readonly _tag: "Failure"; readonly reason: "invalid_pointer" | "untranslatable_pointer"; }; export interface ApplyJsonPatchOptions { readonly getInsertionIndex?: (path: ReadonlyArray, properties: ReadonlyArray) => number; } export type JsonPatchTextResult = { readonly _tag: "Success"; readonly text: string; } | { readonly _tag: "Failure"; readonly reason: "invalid_pointer" | "untranslatable_pointer" | "edit_failed"; }; export declare const jsonPointerToJsonPath: (pointer: string, document: Schema.Json) => JsonPointerPathResult; export declare const applyJsonPatchToText: (text: string, document: Schema.Json, patch: JsonPatch.JsonPatch, options?: ApplyJsonPatchOptions) => JsonPatchTextResult; //# sourceMappingURL=format-preserving-json.d.ts.map