forked from vankop/jsoneditor-react
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjsoneditor-react18.d.ts
72 lines (66 loc) · 2.63 KB
/
jsoneditor-react18.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
export class JsonEditor extends React.Component<JsonEditorProps> {
jsonEditor: any;
}
type Mode = 'tree' | 'view' | 'form' | 'code' | 'text';
interface JsonEditorProps {
value: any;
/** Set the editor mode. Default 'tree' */
mode?: Mode;
/** Initial field name for root node */
name?: string;
/** Validate the JSON object against a JSON schema. */
schema: any;
/** Schemas that are referenced using the $ref property */
schemaRefs?: object;
/**
* If true, object keys in 'tree', 'view' or 'form' mode list be listed alphabetically
* instead by their insertion order.
* */
sortObjectKeys?: boolean;
/** Set a callback function triggered when json in the JSONEditor change */
onChange?: (value: any) => void;
/**
* Set a callback function triggered when an error occurs.
* Invoked with the error as first argument.
* The callback is only invoked for errors triggered by a users action,
* like switching from code mode to tree mode or clicking
* the Format button whilst the editor doesn't contain valid JSON.
*/
onError?: (error: any) => void;
/** Set a callback function triggered right after the mode is changed by the user. */
onModeChange?: (mode: Mode) => void;
onClassName?: (args: {path: any; field: str; value: any}) => void;
/** Provide a version of the Ace editor. Only applicable when mode is code */
ace?: object;
/** Provide a instance of ajv,the library used for JSON schema validation. */
ajv?: object;
/** Set the Ace editor theme, uses included 'ace/theme/jsoneditor' by default. */
theme?: string;
/**
* Enables history, adds a button Undo and Redo to the menu of the JSONEditor.
* Only applicable when mode is 'tree' or 'form'. Default to false
*/
history?: boolean;
/**
* Adds navigation bar to the menu
* the navigation bar visualize the current position on the
* tree structure as well as allows breadcrumbs navigation. Default to true
*/
navigationBar?: boolean;
/**
* Adds status bar to the buttom of the editor
* the status bar shows the cursor position and a count of the selected characters.
* Only applicable when mode is 'code' or 'text'. Default to true
*/
statusBar?: boolean;
/** Enables a search box in the upper right corner of the JSONEditor. Default to true */
search?: boolean;
/** Create a box in the editor menu where the user can switch between the specified modes. */
allowedModes?: Mode[];
/** Html element, or react element to render */
tag?: string | HTMLElement;
/** html element custom props */
htmlElementProps?: object;
/** callback to get html element reference */
innerRef?: (ref: any) => void;
}