diff --git a/jsoneditoronline/jsoneditoronline.d.ts b/jsoneditoronline/jsoneditoronline.d.ts index 9bbb71440..0b441bdf1 100644 --- a/jsoneditoronline/jsoneditoronline.d.ts +++ b/jsoneditoronline/jsoneditoronline.d.ts @@ -23,6 +23,17 @@ class JSONEditorHistory { redo(): void; } +interface JSONEditorNodeUpdateDomOptions { + recurse?: bool; + updateIndexes?: bool; +} + +interface JSONEditorNodeType { + value: string; + className: string; + title: string; +} + class JSONEditorNode { constructor(editor: JSONEditor, params: Object); setParent(parent: JSONEditorNode): void; @@ -53,10 +64,44 @@ class JSONEditorNode { getDom(): HTMLElement; setHighlight(highlight: bool): void; updateValue(value: any): void; + updateField(field: string): void; + updateDom(options): void; + onEvent(event: Event): void; + types: JSONEditorNodeType[]; + getAppend(): HTMLElement; +} + +class JSONEditorAppendNode extends JSONEditorNode { + constructor(editor: JSONEditor); +} + +interface JSONEditorShowDropDownListParams { + x: number; + y: number; + node: JSONEditorNode; + value: string; + values: Object[]; + optionSelectedClassName: string; + optionClassName: string; + callback: (value: any) => void; +} + +class JSONEditorSearchBox { + constructor(editor: JSONEditor, container: HTMLElement); + next(): void; + previous: void; + setActiveResult(index: number): void; + focusActiveResult(): void; + clearDelay(): void; + onDelayedSearch(event: Event): void; + onSearch(event: Event, forcedSearch: bool): void; + onKeyDown(event: Event): void; + onKeyUp(event: Event): void; + } class JSONEditor { - constructor(container: HTMLElement, options?: JSONEditorOptions, json?: Object); + constructor(container: HTMLElement, options?: JSONEditorOptions, json?: any); set(json: Object, name?: string): void; setName(name?: string): void; get(): Object; @@ -69,6 +114,14 @@ class JSONEditor { focus(): void; scrollTo(top: number): void; History: JSONEditorHistory; + Node: JSONEditorNode; + SearchBox: JSONEditorSearchBox; + showDropDownList(): void; + getNodeFromTarget(target: HTMLElement): JSONEditorNode; + Events: { + addEventListener(element: HTMLElement, action: string, ) + }; + } interface JSONFormatterOptions { @@ -77,10 +130,10 @@ interface JSONFormatterOptions { } class JSONFormatter { - constructor(container: HTMLElement, options?: JSONFormatterOptions, json?: Object); - constructor(container: HTMLElement, options?: JSONFormatterOptions, json?: string); - set(json: JSON); - get(): JSON; - setText(jsonString: string); + constructor(container: HTMLElement, options?: JSONFormatterOptions, json?: any); + set(json: Object); + get(): Object; + setText(jsonString: string): void; getText(): string; + onError(err: string): void; } \ No newline at end of file