@types/jsoneditor
Advanced tools
+260
-103
@@ -1,2 +0,2 @@ | ||
| // Type definitions for jsoneditor 9.5 | ||
| // Type definitions for jsoneditor 9.9 | ||
| // Project: https://github.com/josdejong/jsoneditor | ||
@@ -26,8 +26,2 @@ // Definitions by: Alejandro Sánchez <https://github.com/alejo90> | ||
| export interface NodeName { | ||
| path: ReadonlyArray<string>; | ||
| type: NodeType; | ||
| size: number; | ||
| } | ||
| export interface ValidationError { | ||
@@ -45,3 +39,3 @@ path: JSONPath; | ||
| editor: JSONEditor; | ||
| dom: { [key: string]: HTMLElement }; | ||
| dom: Record<string, HTMLElement>; | ||
| editable?: FieldEditable | undefined; | ||
@@ -105,9 +99,14 @@ parent: Node | null; | ||
| export type AutoCompleteGetOptions = ( | ||
| text: string, | ||
| path: JSONPath, | ||
| input: AutoCompleteElementType, | ||
| editor: JSONEditor, | ||
| ) => AutoCompleteCompletion | Promise<AutoCompleteCompletion>; | ||
| export interface AutoCompleteOptions { | ||
| /** | ||
| * Pick one of the two strategies, or define a custom filter function. | ||
| * | ||
| * 'start': Match your input from the start, e.g. 'ap' matches 'apple' but 'pl' does not. | ||
| * | ||
| * 'contain': Contains the user's input or not, e.g. 'pl' matches 'apple' too. | ||
| * - 'start': Match your input from the start, e.g. 'ap' matches 'apple' but 'pl' does not. | ||
| * - 'contain': Contains the user's input or not, e.g. 'pl' matches 'apple' too. | ||
| */ | ||
@@ -117,6 +116,4 @@ filter?: AutoCompleteMatchingStrategy | ((query: string) => boolean) | undefined; | ||
| * Indicate the way to trigger autocomplete menu. | ||
| * | ||
| * 'keydown': When you type something in the field or value, it will trigger autocomplete immediately. | ||
| * | ||
| * 'focus': When you focus in the field or value, it will trigger the autocomplete. | ||
| * - 'keydown': When you type something in the field or value, it will trigger autocomplete immediately. | ||
| * - 'focus': When you focus in the field or value, it will trigger the autocomplete. | ||
| * @default 'keydown' | ||
@@ -142,8 +139,3 @@ */ | ||
| */ | ||
| getOptions?: (( | ||
| text: string, | ||
| path: JSONPath, | ||
| input: AutoCompleteElementType, | ||
| editor: JSONEditor, | ||
| ) => AutoCompleteCompletion | Promise<AutoCompleteCompletion>) | undefined; | ||
| getOptions?: AutoCompleteGetOptions | undefined; | ||
| } | ||
@@ -182,3 +174,3 @@ | ||
| export type MenuItemNodeType = 'single' | 'append'; | ||
| export type MenuItemNodeType = 'single' | 'multiple' | 'append'; | ||
@@ -197,20 +189,139 @@ export interface MenuItemNode { | ||
| export interface QueryFilter { | ||
| field: string | '@'; | ||
| relation: '==' | '!=' | '<' | '<=' | '>' | '>='; | ||
| value: string; | ||
| } | ||
| export interface QuerySort { | ||
| field: string | '@'; | ||
| direction: 'asc' | 'desc'; | ||
| } | ||
| export interface QueryProjection { | ||
| fields: string[]; | ||
| } | ||
| export interface QueryOptions { | ||
| filter?: { | ||
| field: string | '@'; | ||
| relation: '==' | '!=' | '<' | '<=' | '>' | '>='; | ||
| value: string; | ||
| } | undefined; | ||
| sort?: { | ||
| field: string | '@'; | ||
| direction: 'asc' | 'desc'; | ||
| } | undefined; | ||
| projection?: { | ||
| fields: string[]; | ||
| } | undefined; | ||
| filter?: QueryFilter | undefined; | ||
| sort?: QuerySort | undefined; | ||
| projection?: QueryProjection | undefined; | ||
| } | ||
| export interface OnClassNameParams { | ||
| path: ReadonlyArray<string>; | ||
| field: string; | ||
| value: string; | ||
| } | ||
| export interface ExpandOptions { | ||
| path: ReadonlyArray<string>; | ||
| isExpand: boolean; | ||
| recursive: boolean; | ||
| } | ||
| export interface OnNodeNameParams { | ||
| path: ReadonlyArray<string>; | ||
| type: NodeType; | ||
| size: number; | ||
| value: any; | ||
| } | ||
| /** Obtained from master/src/js/i18n.js */ | ||
| export type TranslationKey = | ||
| | 'actionsMenu' | ||
| | 'appendSubmenuTitle' | ||
| | 'appendText' | ||
| | 'appendTitle' | ||
| | 'appendTitleAuto' | ||
| | 'array' | ||
| | 'arrayType' | ||
| | 'ascending' | ||
| | 'ascendingTitle' | ||
| | 'auto' | ||
| | 'autoType' | ||
| | 'cannotParseFieldError' | ||
| | 'cannotParseValueError' | ||
| | 'collapseAll' | ||
| | 'compactTitle' | ||
| | 'containsInvalidItems' | ||
| | 'containsInvalidProperties' | ||
| | 'default' | ||
| | 'descending' | ||
| | 'descendingTitle' | ||
| | 'drag' | ||
| | 'duplicateField' | ||
| | 'duplicateFieldError' | ||
| | 'duplicateKey' | ||
| | 'duplicateText' | ||
| | 'duplicateTitle' | ||
| | 'empty' | ||
| | 'examples' | ||
| | 'expandAll' | ||
| | 'expandTitle' | ||
| | 'extract' | ||
| | 'extractTitle' | ||
| | 'formatTitle' | ||
| | 'insert' | ||
| | 'insertSub' | ||
| | 'insertTitle' | ||
| | 'modeCodeText' | ||
| | 'modeCodeTitle' | ||
| | 'modeEditorTitle' | ||
| | 'modeFormText' | ||
| | 'modeFormTitle' | ||
| | 'modePreviewText' | ||
| | 'modePreviewTitle' | ||
| | 'modeTextText' | ||
| | 'modeTextTitle' | ||
| | 'modeTreeText' | ||
| | 'modeTreeTitle' | ||
| | 'modeViewText' | ||
| | 'modeViewTitle' | ||
| | 'object' | ||
| | 'objectType' | ||
| | 'ok' | ||
| | 'openUrl' | ||
| | 'redo' | ||
| | 'removeField' | ||
| | 'removeText' | ||
| | 'removeTitle' | ||
| | 'repairTitle' | ||
| | 'searchNextResultTitle' | ||
| | 'searchPreviousResultTitle' | ||
| | 'searchTitle' | ||
| | 'selectNode' | ||
| | 'showAll' | ||
| | 'showMore' | ||
| | 'showMoreStatus' | ||
| | 'sort' | ||
| | 'sortAscending' | ||
| | 'sortAscendingTitle' | ||
| | 'sortDescending' | ||
| | 'sortDescendingTitle' | ||
| | 'sortDirectionLabel' | ||
| | 'sortFieldLabel' | ||
| | 'sortFieldTitle' | ||
| | 'sortTitle' | ||
| | 'sortTitleShort' | ||
| | 'string' | ||
| | 'stringType' | ||
| | 'transform' | ||
| | 'transformPreviewLabel' | ||
| | 'transformQueryLabel' | ||
| | 'transformQueryTitle' | ||
| | 'transformTitle' | ||
| | 'transformTitleShort' | ||
| | 'transformWizardFilter' | ||
| | 'transformWizardLabel' | ||
| | 'transformWizardSelectFields' | ||
| | 'transformWizardSortBy' | ||
| | 'type' | ||
| | 'typeTitle' | ||
| | 'undo' | ||
| | 'validationCannotMove'; | ||
| export interface JSONEditorOptions { | ||
| /** | ||
| * Provide a custom version of the Ace editor and use this instead of the version that comes embedded with JSONEditor. Only applicable when mode is 'code'. | ||
| * Provide a custom version of the Ace editor and use this instead of the version that comes embedded with JSONEditor. Only applicable when mode is `code`. | ||
| * | ||
@@ -229,3 +340,3 @@ * Note that when using the minimalist version of JSONEditor (which has Ace excluded), JSONEditor will try to load the Ace plugins `ace/mode/json` and `ace/ext/searchbox`. | ||
| * This callback does not pass the changed contents, use `get()` or `getText()` for that. | ||
| * Note that `get()` can throw an exception in mode 'text', 'code', or 'preview', when the editor contains invalid JSON. | ||
| * Note that `get()` can throw an exception in mode `text`, `code`, or `preview`, when the editor contains invalid JSON. | ||
| * Will only be triggered on changes made by the user, not in case of programmatic changes via the functions `set`, `setText`, `update`, or `updateText`. | ||
@@ -237,5 +348,5 @@ * See also callback functions `onChangeJSON(json)` and `onChangeText(jsonString)`. | ||
| * Set a callback function triggered when the contents of the JSONEditor change. | ||
| * Passes the changed JSON document. Only applicable when option mode is 'tree', 'form', or 'view'. | ||
| * Passes the changed JSON document. Only applicable when option mode is `tree`, `form`, or `view`. | ||
| * The callback will only be triggered on changes made by the user, not in case of programmatic changes via the functions `set`, `setText`, `update`, or `updateText`. | ||
| * Also see the callback function `onChangeText(jsonString)`. | ||
| * @see onChangeText for more details | ||
| */ | ||
@@ -247,3 +358,3 @@ onChangeJSON?: ((json: any) => void) | undefined; | ||
| * The callback will only be triggered on changes made by the user, not in case of programmatic changes via the functions `set`, `setText`, `update`, or `updateText`. | ||
| * Also see the callback function `onChangeJSON(json)`. | ||
| * @see onChangeJSON for more details | ||
| */ | ||
@@ -253,18 +364,19 @@ onChangeText?: ((jsonString: string) => void) | undefined; | ||
| * Set a callback function to add custom CSS classes to the rendered nodes. | ||
| * Only applicable when option mode is 'tree', 'form', or 'view'. | ||
| * Only applicable when option mode is `tree`, `form`, or `view`. | ||
| * The function must either return a string containing CSS class names, or return undefined in order to do nothing for a specific node. | ||
| * In order to update css classes when they depend on external state, you can call `editor.refresh()`. | ||
| */ | ||
| onClassName?: ((classNameParams: { | ||
| path: ReadonlyArray<string>; | ||
| field: string; | ||
| value: string; | ||
| }) => string | undefined) | undefined; | ||
| onClassName?: ((classNameParams: OnClassNameParams) => string | undefined) | undefined; | ||
| /** | ||
| * Set a callback function to be invoked when a node is expanded/collapsed (not programtically via APIs). | ||
| * Only applicable when option mode is `tree`, `form`, or `view`. | ||
| */ | ||
| onExpand?: (expandParams: ExpandOptions) => void | undefined; | ||
| /** | ||
| * Set a callback function to determine whether individual nodes are editable or readonly. | ||
| * Only applicable when option mode is 'tree', 'text', or 'code'. | ||
| * In case of mode 'tree', the callback is invoked as `editable(node)`, where the first parameter is a `Node`. | ||
| * Only applicable when option mode is `tree`, `text`, or `code`. | ||
| * In case of mode `tree`, the callback is invoked as `editable(node)`, where the first parameter is a `Node`. | ||
| * The function must either return a boolean value to set both the nodes field and value editable or readonly, | ||
| * or return `{ field: boolean; value: boolean }` to set the readonly attribute for field and value individually. | ||
| * In modes 'text' and 'code', the callback is invoked as `editable(node)` where node is an empty object (no field, value, or path). | ||
| * In modes `text` and `code`, the callback is invoked as `editable(node)` where node is an empty object (no field, value, or path). | ||
| * In that case the function can return false to make the text or code editor completely readonly. | ||
@@ -276,3 +388,3 @@ */ | ||
| * 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 | ||
| * 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. | ||
@@ -291,3 +403,3 @@ */ | ||
| */ | ||
| onNodeName?: ((nodeName: NodeName) => string | undefined) | undefined; | ||
| onNodeName?: ((nodeName: OnNodeNameParams) => string | undefined) | undefined; | ||
| /** | ||
@@ -298,3 +410,3 @@ * Set a callback function for custom validation. Available in all modes. | ||
| * The function can also return a Promise resolving with the errors retrieved via an asynchronous validation (like sending a request to a server for validation). | ||
| * Also see the option `schema` for JSON schema validation. | ||
| * @see schema for JSON schema validation. | ||
| */ | ||
@@ -306,2 +418,3 @@ onValidate?: ((json: any) => ValidationError[] | Promise<ValidationError[]>) | undefined; | ||
| * On change, the callback will be invoked only if errors were changed. | ||
| * @param errors validation errors | ||
| */ | ||
@@ -322,3 +435,3 @@ onValidationError?: ((errors: ReadonlyArray<SchemaValidationError | ParseError>) => void) | undefined; | ||
| /** | ||
| * If true, object keys in 'tree', 'view' or 'form' mode will be listed alphabetically instead by their insertion order. | ||
| * If true, object keys in `tree`, `view` or `form` mode will be listed alphabetically instead by their insertion order. | ||
| * Sorting is performed using a natural sort algorithm, which makes it easier to see objects that have string numbers as keys. | ||
@@ -329,3 +442,8 @@ * @default false | ||
| /** | ||
| * Enables history, adds a button Undo and Redo to the menu of the JSONEditor. Only applicable when mode is 'tree', 'form', or 'preview'. | ||
| * If false, nodes can be dragged from any parent node to any other parent node. If true, nodes can only be dragged inside the same parent node, which effectively only allows reordering of nodes. | ||
| * By default, limitDragging is true when no JSON schema is defined, and false otherwise. | ||
| */ | ||
| limitDragging?: boolean; | ||
| /** | ||
| * Enables history, adds a button Undo and Redo to the menu of the JSONEditor. Only applicable when mode is `tree`, `form`, or `preview`. | ||
| * @default true | ||
@@ -335,6 +453,6 @@ */ | ||
| /** | ||
| * Set the editor mode. Available values: 'tree', 'view', 'form', 'code', 'text', 'preview'. | ||
| * In 'view' mode, the data and datastructure is readonly. In 'form' mode, only the value can be changed, the data structure is readonly. | ||
| * Mode 'code' requires the Ace editor to be loaded on the page. Mode 'text' shows the data as plain text. | ||
| * The 'preview' mode can handle large JSON documents up to 500 MiB. It shows a preview of the data, and allows to transform, sort, filter, format, or compact the data. | ||
| * Set the editor mode. Available values: `tree`, `view`, `form`, `code`, `text`, `preview`. | ||
| * In `view` mode, the data and datastructure is readonly. In `form` mode, only the value can be changed, the data structure is readonly. | ||
| * Mode `code` requires the Ace editor to be loaded on the page. Mode `text` shows the data as plain text. | ||
| * The `preview` mode can handle large JSON documents up to 500 MiB. It shows a preview of the data, and allows to transform, sort, filter, format, or compact the data. | ||
| * @default 'tree' | ||
@@ -345,7 +463,7 @@ */ | ||
| * Create a box in the editor menu where the user can switch between the specified modes. | ||
| * @see mode. | ||
| * @see mode for configuration | ||
| */ | ||
| modes?: JSONEditorMode[] | undefined; | ||
| /** | ||
| * Initial field name for the root node. Can also be set using `setName(name)`. Only applicable when mode is 'tree', 'view', or 'form'. | ||
| * Initial field name for the root node. Can also be set using `setName(name)`. Only applicable when mode is `tree`, `view`, or `form`. | ||
| * @default undefined | ||
@@ -356,3 +474,3 @@ */ | ||
| * Validate the JSON object against a JSON schema. A JSON schema describes the structure that a JSON object must have, like required properties or the type that a value must have. | ||
| * Also see the option `onValidate` for custom validation. | ||
| * @see onValidate for custom validation. | ||
| * @see http://json-schema.org/ | ||
@@ -366,3 +484,10 @@ */ | ||
| /** | ||
| * Enables a search box in the upper right corner of the JSONEditor. Only applicable when mode is 'tree', 'view', or 'form'. | ||
| * When enabled and schema is configured, the editor will suggest text completions based on the schema properties, examples and enums. | ||
| * - Limitation: the completions will be presented only for a valid json. | ||
| * - Only applicable when mode is `code`. | ||
| * @default false | ||
| */ | ||
| allowSchemaSuggestions?: boolean | undefined; | ||
| /** | ||
| * Enables a search box in the upper right corner of the JSONEditor. Only applicable when mode is `tree`, `view`, or `form`. | ||
| * @default true | ||
@@ -372,3 +497,3 @@ */ | ||
| /** | ||
| * Number of indentation spaces. Only applicable when mode is 'code', 'text', or 'preview'. | ||
| * Number of indentation spaces. Only applicable when mode is `code`, `text`, or `preview`. | ||
| * @default 2 | ||
@@ -387,3 +512,3 @@ */ | ||
| /** | ||
| * Providing this will enable this feature in your editor in 'tree' mode. | ||
| * Providing this will enable this feature in your editor in `tree` mode. | ||
| */ | ||
@@ -398,3 +523,3 @@ autocomplete?: AutoCompleteOptions | undefined; | ||
| * Adds navigation bar to the menu. The navigation bar visualizes the current position on the tree structure as well as allows breadcrumbs navigation. | ||
| * Only applicable when mode is 'tree', 'form' or 'view'. | ||
| * Only applicable when mode is `tree`, `form` or `view`. | ||
| * @default true | ||
@@ -405,3 +530,3 @@ */ | ||
| * Adds status bar to the bottom of the editor. The status bar shows the cursor position and a count of the selected characters. | ||
| * Only applicable when mode is 'code', 'text', or 'preview'. | ||
| * Only applicable when mode is `code`, `text`, or `preview`. | ||
| * @default true | ||
@@ -411,14 +536,32 @@ */ | ||
| /** | ||
| * Set a callback function triggered when a text is selected in the JSONEditor. Only applicable when mode is 'code' or 'text'. | ||
| * Set a callback function triggered when a text is selected in the JSONEditor. | ||
| * Only applicable when mode is `code` or `text`. | ||
| * @param start Selection start position | ||
| * @param end Selected end position | ||
| * @param text selected text | ||
| */ | ||
| onTextSelectionChange?: ((start: SelectionPosition, end: SelectionPosition, text: string) => void) | undefined; | ||
| /** | ||
| * Set a callback function triggered when Nodes are selected in the JSONEditor. Only applicable when mode is 'tree'. | ||
| * Set a callback function triggered when Nodes are selected in the JSONEditor. | ||
| * Only applicable when mode is `tree`. | ||
| * @param start | ||
| * @param end | ||
| */ | ||
| onSelectionChange?: ((start: SerializableNode, end: SerializableNode) => void) | undefined; | ||
| /** | ||
| * Set a callback function that will be triggered when an event will occur in a JSON field or value. Only applicable when mode is 'form', 'tree' or 'view'. | ||
| * Set a callback function that will be triggered when an event will occur in a JSON field or value. | ||
| * Only applicable when mode is `form`, `tree` or `view`. | ||
| * @param node the Node where event has been triggered | ||
| * @param event the event fired | ||
| */ | ||
| onEvent?: ((node: EditableNode, event: string) => void) | undefined; | ||
| onEvent?: ((node: EditableNode, event: Event) => void) | undefined; | ||
| /** | ||
| * Callback method, triggered when the editor comes into focus | ||
| */ | ||
| onFocus?: (event: Event) => void | undefined; | ||
| /** | ||
| * Callback method, triggered when the editor goes out of focus | ||
| */ | ||
| onBlur?: (event: Event) => void | undefined; | ||
| /** | ||
| * When true, values containing a color name or color code will have a color picker rendered on their left side. | ||
@@ -443,3 +586,3 @@ * @default true | ||
| * You can for example test whether a field name contains a string like: 'date' or 'time'. | ||
| * Only applicable for modes 'tree', 'form', and 'view'. | ||
| * Only applicable for modes `tree`, `form`, and `view`. | ||
| * @default true | ||
@@ -451,3 +594,3 @@ * @example ({ field, value, path }) => field === 'dateCreated' | ||
| * Customizing the way formating the timestamp. Called when a value is timestamp after timestampTag. If it returns null, the timestamp would be formatted with default setting. | ||
| * Only applicable for modes 'tree', 'form', and 'view'. | ||
| * Only applicable for modes `tree`, `form`, and `view`. | ||
| * @default value => new Date(value).toISOString() | ||
@@ -466,7 +609,3 @@ */ | ||
| */ | ||
| languages?: { | ||
| [lang: string]: { | ||
| [key: string]: string; | ||
| }; | ||
| } | undefined; | ||
| languages?: Record<string, Partial<Record<TranslationKey, string>>> | undefined; | ||
| /** | ||
@@ -485,3 +624,3 @@ * The container element where modals (like for sorting and filtering) are attached: | ||
| /** | ||
| * Enable sorting of arrays and object properties. Only applicable for mode 'tree'. | ||
| * Enable sorting of arrays and object properties. Only applicable for mode `tree`. | ||
| * @default true | ||
@@ -491,3 +630,3 @@ */ | ||
| /** | ||
| * Enable filtering, sorting, and transforming JSON using a {@link https://jmespath.org/|JMESPath} query. Only applicable for mode 'tree'. | ||
| * Enable filtering, sorting, and transforming JSON using a {@link https://jmespath.org/|JMESPath} query. Only applicable for mode `tree`. | ||
| * @default true | ||
@@ -497,3 +636,3 @@ */ | ||
| /** | ||
| * Number of children allowed for a given node before the 'show more/show all' message appears (in 'tree', 'view', or 'form' modes). | ||
| * Number of children allowed for a given node before the 'show more/show all' message appears (in `tree`, `view`, or `form` modes). | ||
| * @default 100 | ||
@@ -519,7 +658,2 @@ */ | ||
| queryDescription?: string | undefined; | ||
| /** | ||
| * If false, nodes can be dragged from any parent node to any other parent node. If true, nodes can only be dragged inside the same parent node, which effectively only allows reordering of nodes. | ||
| * By default, limitDragging is true when no JSON schema is defined, and false otherwise. | ||
| */ | ||
| limitDragging?: boolean; | ||
| } | ||
@@ -537,3 +671,3 @@ | ||
| /** | ||
| * Collapse all fields. Only applicable for mode 'tree', 'view', and 'form'. | ||
| * Collapse all fields. Only applicable for mode `tree`, `view`, and `form`. | ||
| */ | ||
@@ -546,6 +680,13 @@ collapseAll(): void; | ||
| /** | ||
| * Expand all fields. Only applicable for mode 'tree', 'view', and 'form'. | ||
| * Expand all fields. Only applicable for mode `tree`, `view`, and `form`. | ||
| */ | ||
| expandAll(): void; | ||
| /** | ||
| * Expand/collapse a given JSON node. Only applicable for mode 'tree', 'view' and 'form'. | ||
| * @param expandParams.path Path for the node to expand / collapse | ||
| * @param expandParams.isExpand Whether to expand the node (else collapse) | ||
| * @param expandParams.recursive Whether to expand/collapse child nodes recursively | ||
| */ | ||
| expand(options: ExpandOptions): void; | ||
| /** | ||
| * Set focus to the JSONEditor. | ||
@@ -555,3 +696,3 @@ */ | ||
| /** | ||
| * Get JSON data. This method throws an exception when the editor does not contain valid JSON, which can be the case when the editor is in mode 'code', 'text', or 'preview'. | ||
| * Get JSON data. This method throws an exception when the editor does not contain valid JSON, which can be the case when the editor is in mode `code`, `text`, or `preview`. | ||
| */ | ||
@@ -575,7 +716,7 @@ get(): any; | ||
| /** | ||
| * Get the current selected nodes. Only applicable for mode 'tree'. | ||
| * Get the current selected nodes. Only applicable for mode `tree`. | ||
| */ | ||
| getSelection(): { start: SerializableNode; end: SerializableNode }; | ||
| /** | ||
| * Get JSON data as string. Returns the contents of the editor as string. When the editor is in mode 'text', 'code' or 'preview', the returned text is returned as-is. | ||
| * Get JSON data as string. Returns the contents of the editor as string. When the editor is in mode `text`, `code` or `preview`, the returned text is returned as-is. | ||
| * For the other modes, the returned text is a compacted string. In order to get the JSON formatted with a certain number of spaces, use `JSON.stringify(JSONEditor.get(), null, 2)`. | ||
@@ -585,3 +726,3 @@ */ | ||
| /** | ||
| * Get the current selected text with the selection range. Only applicable for mode 'text' and 'code'. | ||
| * Get the current selected text with the selection range. Only applicable for mode `text` and `code`. | ||
| */ | ||
@@ -595,3 +736,3 @@ getTextSelection(): { start: SelectionPosition; end: SelectionPosition; text: string }; | ||
| * Set JSON data. Resets the state of the editor (expanded nodes, search, selection). | ||
| * @see update() | ||
| * @see update for more details | ||
| * @param json JSON data to be displayed in the JSONEditor | ||
@@ -601,3 +742,3 @@ */ | ||
| /** | ||
| * Switch mode. Mode 'code' requires the Ace editor. | ||
| * Switch mode. Mode `code` requires the Ace editor. | ||
| */ | ||
@@ -607,2 +748,3 @@ setMode(mode: JSONEditorMode): void; | ||
| * Set a field name for the root node. | ||
| * @param name Field name of the root node. If undefined, the current name will be removed. | ||
| */ | ||
@@ -612,26 +754,35 @@ setName(name?: string): void; | ||
| * Set a JSON schema for validation of the JSON object. See also option `schema`. See http://json-schema.org/ for more information on the JSON schema definition. | ||
| * @param schema A JSON schema. | ||
| * @param schemaRefs Schemas that are referenced using the `$ref` property from the JSON schema, the object structure in the form of `{ reference_key: schemaObject }` | ||
| */ | ||
| setSchema(schema: object, schemaRefs?: object): void; | ||
| /** | ||
| * Set selection for a range of nodes, Only applicable for mode 'tree'. | ||
| * If no parameters sent - the current selection will be removed, if exists. | ||
| * For single node selection send only the start parameter. | ||
| * If the nodes are not from the same level the first common parent will be selected. | ||
| * Set selection for a range of nodes. Only applicable for mode `tree`. | ||
| * - If no parameters sent - the current selection will be removed, if exists. | ||
| * - For single node selection send only the start parameter. | ||
| * - If the nodes are not from the same level the first common parent will be selected. | ||
| * @param start Path for the start node | ||
| * @param end Path for the end node | ||
| */ | ||
| setSelection(start: { path: JSONPath }, end: { path: JSONPath }): void; | ||
| /** | ||
| * Set text data in the editor. This method throws an exception when the provided jsonString does not contain valid JSON and the editor is in mode 'tree', 'view', or 'form'. | ||
| * Set text data in the editor. This method throws an exception when the provided jsonString does not contain valid JSON and the editor is in mode `tree`, `view`, or `form`. | ||
| * @param jsonString Contents of the editor as string. | ||
| */ | ||
| setText(jsonString: string): void; | ||
| /** | ||
| * Set text selection for a range, Only applicable for mode 'text' and 'code'. | ||
| * Set text selection for a range, Only applicable for mode `text` and `code`. | ||
| * @param start Position for selection start | ||
| * @param end Position for selection end | ||
| */ | ||
| setTextSelection(start: SelectionPosition, end: SelectionPosition): void; | ||
| /** | ||
| * Replace JSON data when the new data contains changes. In modes 'tree', 'form', and 'view', the state of the editor will be maintained (expanded nodes, search, selection). See also `set`. | ||
| * Replace JSON data when the new data contains changes. In modes `tree`, `form`, and `view`, the state of the editor will be maintained (expanded nodes, search, selection). See also `set`. | ||
| * @param json JSON data to be displayed in the JSONEditor. | ||
| */ | ||
| update(json: any): void; | ||
| /** | ||
| * Replace text data when the new data contains changes. In modes 'tree', 'form', and 'view', the state of the editor will be maintained (expanded nodes, search, selection). | ||
| * Also see `setText()`. This method throws an exception when the provided jsonString does not contain valid JSON and the editor is in mode 'tree', 'view', or 'form'. | ||
| * Replace text data when the new data contains changes. In modes `tree`, `form`, and `view`, the state of the editor will be maintained (expanded nodes, search, selection). | ||
| * @see setText for more details | ||
| * @param jsonString Contents of the editor as string. | ||
| */ | ||
@@ -641,3 +792,3 @@ updateText(jsonString: string): void; | ||
| * Validate the JSON document against the configured JSON schema or custom validator. See also the `onValidationError` callback. | ||
| * Returns a promise which resolves with the current validation errors, or an empty list when there are no errors. | ||
| * @returns a promise which resolves with the current validation errors, or an empty list when there are no errors. | ||
| */ | ||
@@ -647,2 +798,8 @@ validate(): Promise<ReadonlyArray<SchemaValidationError | ParseError>>; | ||
| /** | ||
| * (UNDOCUMENTED) | ||
| * Points to the AceEditor instance for the current JsonEditor instance | ||
| */ | ||
| aceEditor: AceAjax.Editor; | ||
| /** | ||
| * An array with the names of all known options. | ||
@@ -649,0 +806,0 @@ */ |
| { | ||
| "name": "@types/jsoneditor", | ||
| "version": "9.5.1", | ||
| "version": "9.9.0", | ||
| "description": "TypeScript definitions for jsoneditor", | ||
@@ -41,4 +41,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsoneditor", | ||
| }, | ||
| "typesPublisherContentHash": "f726ee89e88c524978911a4465dc42b15d3647da2b0958ea49798078dcc24e93", | ||
| "typeScriptVersion": "3.7" | ||
| "typesPublisherContentHash": "1d119446cc362ffd16d9225155d613fbefa119f9c76121b6007ac377481dac70", | ||
| "typeScriptVersion": "4.1" | ||
| } |
@@ -11,3 +11,3 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Fri, 22 Oct 2021 02:01:23 GMT | ||
| * Last updated: Mon, 12 Sep 2022 07:32:40 GMT | ||
| * Dependencies: [@types/ajv](https://npmjs.com/package/@types/ajv), [@types/ace](https://npmjs.com/package/@types/ace) | ||
@@ -14,0 +14,0 @@ * Global values: none |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
37129
13.92%736
25.38%2
100%