import React$1, { SVGProps } from 'react'; declare const localisedStrings: { ITEM_SINGLE: string; ITEMS_MULTIPLE: string; ITEMS_FILTERED: string; KEY_NEW: string; KEY_SELECT: string; NO_KEY_OPTIONS: string; ERROR_KEY_EXISTS: string; ERROR_INVALID_JSON: string; ERROR_UPDATE: string; ERROR_DELETE: string; ERROR_ADD: string; ERROR_RENAME: string; ERROR_MOVE: string; DEFAULT_NEW_KEY: string; SHOW_LESS: string; SHOW_MORE: string; EMPTY_STRING: string; TOOLTIP_COPY: string; TOOLTIP_EDIT: string; TOOLTIP_DELETE: string; TOOLTIP_ADD: string; TOOLTIP_OK: string; TOOLTIP_CANCEL: string; TOOLTIP_COLLAPSE: string; TOOLTIP_EXPAND: string; }; type LocalisedStrings = typeof localisedStrings; type TranslateFunction = (key: keyof LocalisedStrings, customData: NodeData, counts?: number | Record) => string; interface CustomNodeData { CustomComponent?: React.FC; CustomWrapperComponent?: React.FC; CustomKeyComponent?: React.FC; name?: string; componentProps?: Record; wrapperProps?: Record; showKey?: boolean; defaultValue?: unknown; showInTypeSelector?: boolean; editOnTypeSwitch?: boolean; showOnEdit?: boolean; showOnView?: boolean; showEditTools?: boolean; showCollectionWrapper?: boolean; passOriginalNode?: boolean; renderCollectionAsValue?: boolean; toStandardType?: (value: unknown) => ValueData; fromStandardType?: (value: unknown, nodeData: NodeData, componentProps?: Record) => unknown; } interface SelectProps { options: string[]; value?: string; defaultValue?: string; onChange: (value: string) => void; onKeyDown?: (e: React$1.KeyboardEvent) => void; autoFocus?: boolean; placeholder?: string; name?: string; className?: string; } type JsonData = Record | Array | unknown; interface JsonEditorProps { data: T; setData: (data: T) => void; rootName?: string; onUpdate?: UpdateFunction; onChange?: OnChangeFunction; onError?: OnErrorFunction; showErrorMessages?: boolean; showClipboardButton?: boolean; theme?: ThemeInput; className?: string; id?: string; indent?: number; collapse?: boolean | number | FilterFunction; collapseAnimationTime?: number; showCollectionCount?: boolean | 'when-collapsed' | 'when-collapsed-or-filtered'; allowEdit?: boolean | FilterFunction; allowDelete?: boolean | FilterFunction; allowAdd?: boolean | FilterFunction; allowTypeSelection?: boolean | TypeOptions | TypeFilterFunction; allowDrag?: boolean | FilterFunction; searchText?: string; searchFilter?: 'key' | 'value' | 'all' | SearchFilterFunction; searchDebounceTime?: number; sortKeys?: boolean | CompareFunction; showArrayIndexes?: boolean; arrayIndexStart?: number; showStringQuotes?: boolean; showIconTooltips?: boolean; defaultValue?: string | number | boolean | null | object | DefaultValueFunction; newKeyOptions?: string[] | NewKeyOptionsFunction; minWidth?: string | number; maxWidth?: string | number; baseFontSize?: string | number; stringTruncateLength?: number; translations?: Partial; customNodeDefinitions?: CustomNodeDefinition, Record>[]; customText?: CustomTextDefinitions; customButtons?: CustomButtonDefinition[]; jsonParse?: (input: string, reviver?: (key: string, value: string) => unknown) => JsonData; jsonStringify?: (input: JsonData, replacer?: (key: string, value: unknown) => unknown) => string; TextEditor?: React.FC; Select?: React.ComponentType; errorDisplayTime?: number; keyboardControls?: KeyboardControls; insertAtTop?: boolean | 'array' | 'object'; collapseClickZones?: Array<'left' | 'header' | 'property'>; onEditEvent?: OnEditEventFunction; onCollapse?: OnCollapseFunction; onCopy?: OnCopyFunction; editorRef?: React.Ref; } interface StartEditOptions { path: CollectionKey[]; overrideRestrictions?: boolean; } type StartEditResult = true | 'RESTRICTED' | 'PATH_NOT_FOUND'; interface JsonEditorHandle { collapse: (state: CollapseState | CollapseState[]) => void; startEdit: (options: StartEditOptions) => StartEditResult; confirm: () => void; cancel: () => void; } type JsonViewerHandle = Pick; type JsonViewerProps = Omit, 'setData' | 'onUpdate' | 'onChange' | 'allowEdit' | 'allowAdd' | 'allowDelete' | 'allowDrag' | 'allowTypeSelection' | 'editorRef'> & { editorRef?: React.Ref; }; declare const valueDataTypes: readonly ["string", "number", "boolean", "null"]; declare const collectionDataTypes: readonly ["object", "array"]; declare const standardDataTypes: readonly ["string", "number", "boolean", "null", "object", "array"]; type DataType = (typeof standardDataTypes)[number] | 'invalid'; type CollectionKey = string | number; type CollectionData = object | unknown[]; interface EnumDefinition { enum: string; values: string[]; matchPriority?: number; } type TypeOptions = Array; type ErrorString = string; type EditOperation = 'edit' | 'rename' | 'add' | 'delete' | 'move'; interface TextEditorProps { value: string; onChange: (value: string) => void; onKeyDown: (e: React.KeyboardEvent) => void; } type JerErrorCode = 'UPDATE_ERROR' | 'ADD_ERROR' | 'DELETE_ERROR' | 'RENAME_ERROR' | 'MOVE_ERROR' | 'KEY_EXISTS' | 'INVALID_JSON' | 'CLIPBOARD_ERROR'; interface JerError { code: JerErrorCode; message: string; } type UpdateResult = true | void | undefined | false | null | { value?: unknown; data?: T; error?: string | JerError; }; type UpdateFunctionProps = NodeData & { newData: T; } & ({ event: 'edit'; newValue: unknown; } | { event: 'add'; newValue: unknown; } | { event: 'delete'; } | { event: 'rename'; newKey: string; } | { event: 'move'; newPath: CollectionKey[]; }); interface UpdateControl { hold: () => () => void; } type UpdateFunction = (props: UpdateFunctionProps, control: UpdateControl) => UpdateResult | Promise>; type OnChangeFunction = (props: NodeData & { newValue: ValueData; }) => ValueData; type OnErrorFunction = (props: NodeData & { error: JerError; errorValue: JsonData; }) => void; type FilterFunction = (input: NodeData) => boolean; type TypeFilterFunction = (input: NodeData) => boolean | TypeOptions; type CustomTextFunction = (input: NodeData) => string | null; type DefaultValueFunction = (input: NodeData, newKey?: string) => unknown; type SearchFilterFunction = (inputData: NodeData, searchText: string) => boolean; type NewKeyOptionsFunction = (input: NodeData) => string[] | null | void; type CopyType = 'path' | 'value'; type OnCopyFunction = (props: NodeData & { success: boolean; stringValue: string; type: CopyType; error?: JerError; }) => void; type CompareFunction = (a: [string | number, unknown], b: [string | number, unknown]) => number; type SortFunction = (arr: T[], nodeMap: (input: T) => [string | number, unknown]) => void; type EditEvent = NodeData & ({ event: 'startEdit'; } | { event: 'submitEdit'; } | { event: 'commitEdit'; } | { event: 'cancelEdit'; } | { event: 'startRename'; } | { event: 'submitRename'; } | { event: 'commitRename'; oldKey: CollectionKey; newKey: CollectionKey; } | { event: 'cancelRename'; } | { event: 'startAdd'; } | { event: 'submitAdd'; } | { event: 'commitAdd'; } | { event: 'cancelAdd'; } | { event: 'delete'; } | { event: 'move'; } | { event: 'updateSuccess'; operation: EditOperation; } | { event: 'updateError'; operation: EditOperation; error: JerError; }); type OnEditEventFunction = (e: EditEvent) => void; interface CollapseState { path: CollectionKey[]; collapsed: boolean; includeChildren: boolean; } type OnCollapseFunction = (props: NodeData & { collapsed: boolean; includeChildren: boolean; }) => void; interface KeyEvent { key: string; modifier?: React.ModifierKey | React.ModifierKey[]; } interface KeyboardControls { confirm?: KeyEvent | string | null; cancel?: KeyEvent | string | null; objectConfirm?: KeyEvent | string | null; objectLineBreak?: KeyEvent | string | null; stringConfirm?: KeyEvent | string | null; stringLineBreak?: KeyEvent | string | null; booleanConfirm?: KeyEvent | string | null; booleanToggle?: KeyEvent | string | null; numberConfirm?: KeyEvent | string | null; numberUp?: KeyEvent | string | null; numberDown?: KeyEvent | string | null; tabForward?: KeyEvent | string | null; tabBack?: KeyEvent | string | null; clipboardModifier?: React.ModifierKey | React.ModifierKey[] | null; collapseModifier?: React.ModifierKey | React.ModifierKey[] | null; } type KeyboardControlsFull = Omit, 'clipboardModifier' | 'collapseModifier'> & { clipboardModifier: React.ModifierKey[]; collapseModifier: React.ModifierKey[]; }; interface NodeData { key: CollectionKey; path: CollectionKey[]; level: number; index: number; value: JsonData; size: number | null; visibleSize?: number | null; parentData: object | null; fullData: T; collapsed?: boolean; } interface BaseNodeProps { data: unknown; parentData: CollectionData | null; nodeData: NodeData; getLatestData: () => JsonData; onError?: OnErrorFunction; showErrorMessages: boolean; showIconTooltips: boolean; showClipboardButton: boolean; onCopy?: OnCopyFunction; onEditEvent?: OnEditEventFunction; allowEditFilter: FilterFunction; allowDeleteFilter: FilterFunction; allowAddFilter: FilterFunction; allowDragFilter: FilterFunction; canDragOnto: boolean; canAddHere: boolean; allowTypeSelection: boolean | TypeOptions | TypeFilterFunction; stringTruncateLength: number; indent: number; arrayIndexStart: number; sort: SortFunction; translate: TranslateFunction; customNodeDefinitions: CustomNodeDefinition[]; customNodeData: CustomNodeData; customButtons: CustomButtonDefinition[]; Select: React.ComponentType; errorDisplayTime: number; keyboardControls: KeyboardControlsFull; handleKeyboard: (e: React.KeyboardEvent, eventMap: Partial void>>) => void; editConfirmRef: React.RefObject; jsonStringify: (data: JsonData, replacer?: (this: any, key: string, value: unknown) => string) => string; } interface CollectionNodeProps extends BaseNodeProps { mainContainerRef: React.RefObject; data: CollectionData; collapseFilter: FilterFunction; collapseAnimationTime: number; showArrayIndexes: boolean; showCollectionCount: boolean | 'when-collapsed' | 'when-collapsed-or-filtered'; showStringQuotes: boolean; defaultValue: unknown; newKeyOptions?: string[] | NewKeyOptionsFunction; jsonParse: (input: string, reviver?: (this: any, key: string, value: string) => unknown) => JsonData; insertAtTop: { object: boolean; array: boolean; }; TextEditor?: React.FC; onCollapse?: OnCollapseFunction; collapseClickZones: Array<'left' | 'header' | 'property'>; } type ValueData = string | number | boolean; interface ValueNodeProps extends BaseNodeProps { data: ValueData; showLabel: boolean; showStringQuotes: boolean; onChange?: OnChangeFunction; } interface CustomKeyProps> { nodeData: NodeData; name: string; path: CollectionKey[]; canEditKey: boolean; handleEditKey: (newKey: string) => void; startEditingKey: () => void; handleClick?: (e: React.MouseEvent) => void; styles: React.CSSProperties; componentProps?: T; getStyles: (element: ThemeableElement, nodeData: NodeData) => React.CSSProperties; } interface CustomComponentProps> extends Omit { value: JsonData; componentProps?: T; parentData: CollectionData | null; setValue: (value: JsonData) => void; handleEdit: (value?: JsonData) => void; handleCancel: () => void; onKeyDown: (e: React.KeyboardEvent) => void; isEditing: boolean; isPending: boolean; setIsEditing: React.Dispatch>; getStyles: (element: ThemeableElement, nodeData: NodeData) => React.CSSProperties; children?: React.JSX.Element | React.JSX.Element[] | null; originalNode?: React.JSX.Element; originalNodeKey?: React.JSX.Element; canEdit: boolean; keyboardCommon: Partial void>>; } interface CustomWrapperProps> extends Omit { wrapperProps?: U; } interface CustomNodeDefinition, U = Record> { condition: FilterFunction; component?: React.FC>; keyComponent?: React.FC>; name?: string; componentProps?: T; showKey?: boolean; defaultValue?: unknown; showInTypeSelector?: boolean; showOnEdit?: boolean; showOnView?: boolean; editOnTypeSwitch?: boolean; showEditTools?: boolean; passOriginalNode?: boolean; showCollectionWrapper?: boolean; wrapperComponent?: React.FC>; wrapperProps?: U; renderCollectionAsValue?: boolean; stringifyReplacer?: (value: unknown) => unknown; parseReviver?: (stringified: string) => unknown; toStandardType?: (value: unknown) => ValueData; fromStandardType?: (value: unknown, nodeData: NodeData, componentProps?: T) => unknown; } type CustomTextDefinitions = Partial<{ [key in keyof LocalisedStrings]: CustomTextFunction; }>; type CustomButtonHandleEdit = (value: JsonData) => void; interface CustomButtonElementProps { nodeData: NodeData; canEdit: boolean; handleEdit: CustomButtonHandleEdit; } interface CustomButtonDefinition { Element: React.FC; onClick?: (nodeData: NodeData, e: React.MouseEvent, context: { handleEdit: CustomButtonHandleEdit; canEdit: boolean; }) => void; label?: string; } type ThemeableElement = 'container' | 'collection' | 'collectionInner' | 'collectionElement' | 'headerRow' | 'valueRow' | 'dropZone' | 'property' | 'bracket' | 'itemCount' | 'string' | 'number' | 'boolean' | 'null' | 'input' | 'inputHighlight' | 'error' | 'iconCollection' | 'iconEdit' | 'iconDelete' | 'iconAdd' | 'iconCopy' | 'iconOk' | 'iconCancel'; type StyleFunction = (nodeData: NodeData) => React.CSSProperties | null | undefined; type ThemeValueUnit = string | React.CSSProperties | StyleFunction; type ThemeElementValue = ThemeValueUnit | ThemeValueUnit[]; type ThemeFragments = Record; type ThemeStyles = Partial, ThemeElementValue>> & { inputHighlight?: string; }; interface IconDefinition { content: React.ReactNode; viewBox?: string; svgProps?: React.SVGProps; scale?: number; } interface ThemeIcons { add?: IconDefinition; edit?: IconDefinition; delete?: IconDefinition; copy?: IconDefinition; ok?: IconDefinition; cancel?: IconDefinition; collection?: IconDefinition; } interface Theme { displayName?: string; fragments?: ThemeFragments; icons?: ThemeIcons; styles: ThemeStyles; } type ThemeInput = Theme | ThemeStyles | Array; declare function JsonEditor(props: JsonEditorProps): React$1.ReactElement; declare function JsonViewer(props: JsonViewerProps): React$1.ReactElement | null; declare const defaultTheme: Theme; interface StringDisplayProps { nodeData: NodeData; styles: React$1.CSSProperties; pathString: string; showStringQuotes?: boolean; stringTruncateLength?: number; canEdit: boolean; setIsEditing: (value: React$1.SetStateAction) => void; translate: TranslateFunction; showIconTooltips?: boolean; value?: string; TextWrapper?: React$1.ComponentType<{ children: React$1.ReactNode; }>; } declare const StringDisplay: React$1.FC; interface StringEditProps { styles: React$1.CSSProperties; pathString: string; value: string; setValue: React$1.Dispatch>; handleEdit: () => void; handleKeyboard: (e: React$1.KeyboardEvent, eventMap: Partial void>>) => void; keyboardCommon: Partial void>>; } declare const StringEdit: React$1.FC; declare const useKeyboardListener: (isEditing: boolean, listener: (e: unknown) => void) => void; interface TextAreaProps { className: string; name: string; value: string; setValue: React$1.Dispatch>; onKeyDown: (e: React$1.KeyboardEvent) => void; styles: React$1.CSSProperties; textAreaRef?: React$1.MutableRefObject; } declare const AutogrowTextArea: React$1.FC; declare const IconSvg: ({ scale, viewBox, fill, children, ...props }: { scale?: number; } & Omit, "scale">) => React.JSX.Element; declare const matchNode: (input: Partial, searchText: string) => boolean; declare const matchNodeKey: SearchFilterFunction; declare const isCollection: (value: unknown) => value is Record | unknown[]; type Path = (string | number)[]; declare const splitPropertyString: (propertyPath: string) => Path; declare const toPathString: (path: CollectionKey[]) => string; type BasicType = string | number | boolean | undefined | null | ((...args: unknown[]) => unknown); type Value = AssignInput | BasicType; type InputObject$1 = { [key: string]: Value; }; type InputArray = Value[]; type AssignInput = InputObject$1 | InputArray; interface AssignOptions { remove?: boolean; noError?: boolean; createNew?: boolean; insert?: boolean; insertBefore?: string | number; insertAfter?: string | number; } declare const assign: (data: AssignInput, propertyPath: string | Path, newValue: any, options?: AssignOptions) => AssignInput; type BasicObject = { [key: string]: BasicObject | unknown | (BasicObject | unknown)[]; }; type BasicArray = (BasicObject | unknown)[]; type InputObject = BasicObject | BasicArray | unknown; declare const extract: (inputObj: InputObject, properties: string | number | (string | number)[], fallback?: any) => any; export { AutogrowTextArea, IconSvg, JsonEditor, JsonViewer, StringDisplay, StringEdit, assign, collectionDataTypes, defaultTheme, extract, isCollection, matchNode, matchNodeKey, splitPropertyString, standardDataTypes, toPathString, useKeyboardListener, valueDataTypes }; export type { AssignInput, AssignOptions, CollapseState, CollectionNodeProps, CompareFunction, CustomButtonDefinition, CustomButtonElementProps, CustomComponentProps, CustomKeyProps, CustomNodeDefinition, CustomTextDefinitions, CustomTextFunction, CustomWrapperProps, DataType, DefaultValueFunction, EditEvent, EnumDefinition, ErrorString, FilterFunction, IconDefinition, JerError, JerErrorCode, JsonData, JsonEditorHandle, JsonEditorProps, JsonViewerHandle, JsonViewerProps, KeyboardControls, LocalisedStrings, NewKeyOptionsFunction, NodeData, OnChangeFunction, OnCollapseFunction, OnCopyFunction, OnEditEventFunction, OnErrorFunction, SearchFilterFunction, SelectProps, StartEditOptions, StartEditResult, TextEditorProps, Theme, ThemeIcons, ThemeInput, ThemeStyles, TranslateFunction, TypeFilterFunction, TypeOptions, UpdateFunction, UpdateFunctionProps, UpdateResult, ValueNodeProps };