/// export declare const JSONTypes: readonly ["string", "number", "object", "array", "boolean", "null"]; export type JSONType = (typeof JSONTypes)[number]; export type JSONEditorValueType = boolean | null | number | string | object | any[]; export type JSONEditableValueType = boolean | number | string; export type JSONEditorPath = string | number; export declare function getJSONType(value: JSONEditorValueType): JSONType; export declare function updateNestedProperty(root: any, path: (string | number)[], value: any): any; export declare function updateNestedPropertyImmutable(root: any, path: (string | number)[], value: any): any; export declare function arrayMoveMutable(array: any[], fromIndex: number, toIndex: number): void; export declare function arrayMoveImmutable(array: any[], fromIndex: number, toIndex: number): any[]; export declare function getNestedProperty(root: any, path: (string | number)[]): any; export type JSONEditorReducerState = { value: JSONEditorValueType; path: JSONEditorPath[]; /** * if current is an object, put initial properties to currentProperties * to keep them in order */ currentProperties: string[]; }; export type JSONEditorAction = { type: 'navigate'; payload: string[]; } | { type: 'change-child-type'; payload: { type: JSONType; childName: string | number; }; } | { type: 'change-child-value'; payload: { value: JSONEditableValueType; childName: string | number; }; } | { type: 'change-current-type'; payload: { type: JSONType; }; } | { type: 'change-current-value'; payload: { value: JSONEditableValueType; }; } | { type: 'change-child-name'; payload: { from: string; to: string; } | { from: number; to: number; }; } | { type: 'add-child'; payload?: null; } | { type: 'remove-child'; payload: { childName: string | number; }; } | { type: 'undo'; payload?: null; } | { type: 'redo'; payload?: null; }; export type JSONEditorState = JSONEditorReducerState & { navigate: (pathList: (string | number)[]) => void; addChild: () => void; removeChild: (payload: { childName: string | number; }) => void; changeChildName: (payload: { from: string; to: string; } | { from: number; to: number; }) => void; changeCurrentType: (payload: { type: JSONType; }) => void; changeCurrentValue: (payload: { value: JSONEditableValueType; }) => void; changeChildType: (payload: { childName: string | number; type: JSONType; }) => void; changeChildValue: (payload: { childName: string | number; value: JSONEditableValueType; }) => void; canUndo: () => boolean; canRedo: () => boolean; undo: () => void; redo: () => void; readOnly: boolean; }; export declare const JSONContext: import("react").Context; export declare const useJSON: () => JSONEditorState; export declare function makeTransparent(colorString: any, opacity?: number): string; export declare const JSONTypeColor: { string: string; number: string; array: string; boolean: string; object: string; null: string; };