UNPKG

865 BTypeScriptView Raw
1/**
2 * https://tools.ietf.org/html/rfc6902
3 * http://jsonpatch.com/
4 */
5export interface IJsonPatch {
6 readonly op: "replace" | "add" | "remove";
7 readonly path: string;
8 readonly value?: any;
9}
10export interface IReversibleJsonPatch extends IJsonPatch {
11 readonly oldValue: any;
12}
13/**
14 * Escape slashes and backslashes.
15 *
16 * http://tools.ietf.org/html/rfc6901
17 */
18export declare function escapeJsonPath(path: string): string;
19/**
20 * Unescape slashes and backslashes.
21 */
22export declare function unescapeJsonPath(path: string): string;
23/**
24 * Generates a json-path compliant json path from path parts.
25 *
26 * @param path
27 * @returns
28 */
29export declare function joinJsonPath(path: string[]): string;
30/**
31 * Splits and decodes a json path into several parts.
32 *
33 * @param path
34 * @returns
35 */
36export declare function splitJsonPath(path: string): string[];