import { Path } from '../parent/pathTypes'; import { Patch } from './Patch'; export type JsonPatch = JsonPatchAddOperation | JsonPatchRemoveOperation | JsonPatchReplaceOperation; export interface JsonPatchBaseOperation { path: string; } export interface JsonPatchAddOperation extends JsonPatchBaseOperation { op: "add"; value: T; } export interface JsonPatchRemoveOperation extends JsonPatchBaseOperation { op: "remove"; } export interface JsonPatchReplaceOperation extends JsonPatchBaseOperation { op: "replace"; value: T; } /** * Converts a path into a JSON pointer. * * @param path Path to convert. * @returns Converted JSON pointer. */ export declare function pathToJsonPointer(path: Path): string; /** * Converts a JSON pointer into a path. * * @param jsonPointer JSON pointer to convert. * @returns Converted path. */ export declare function jsonPointerToPath(jsonPointer: string): Path; /** * Convert a patch into a JSON patch. * * @param patch A patch. * @returns A JSON patch. */ export declare function patchToJsonPatch(patch: Patch): JsonPatch; /** * Converts a JSON patch into a patch. * * @param jsonPatch A JSON patch. * @returns A patch. */ export declare function jsonPatchToPatch(jsonPatch: JsonPatch): Patch;