diff --git a/types/tinymce/index.d.ts b/types/tinymce/index.d.ts index 5f65ea0a2c..7cc40943e7 100644 --- a/types/tinymce/index.d.ts +++ b/types/tinymce/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for TinyMCE 4.5 // Project: https://github.com/tinymce/tinymce -// Definitions by: Martin Duparc +// Definitions by: Martin Duparc , Poul Poulsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Work In Progress @@ -51,7 +51,7 @@ export function walk(o: {}, f: () => void, n?: string, s?: string): void; export function init(settings: Settings): void; -interface Settings { +export interface Settings { table_toolbar?: boolean; auto_focus?: string; @@ -265,6 +265,16 @@ interface Settings { object_resizing?: boolean | string; type_ahead_urls?: boolean; + + autosave_ask_before_unload?: boolean; + + autosave_interval?: string; + + autosave_prefix?: string; + + autosave_restore_when_empty?: boolean; + + autosave_retention?: string; } export namespace settings { @@ -424,7 +434,7 @@ export class Editor extends util.Observable { uploadImages(callback: () => void): Promise; } -interface EditorCommands { +export interface EditorCommands { addCommands(command_list: {}, type?: string): void; execCommand(command: string, ui?: boolean, value?: {}, args?: {}): boolean; @@ -436,7 +446,7 @@ interface EditorCommands { queryCommandValue(command: string): {}; } -interface EditorManager extends util.Observable { +export interface EditorManager extends util.Observable { $: dom.DomQuery; activeEditor: Editor; @@ -482,7 +492,7 @@ interface EditorManager extends util.Observable { triggerSave(): void; } -interface Env { +export interface Env { android: boolean; ceFalse: boolean; @@ -591,7 +601,7 @@ export class FocusManager { static isEditorUIElement(elm: Element): boolean; } -interface Formatter { +export interface Formatter { apply(name: string, vars?: {}, node?: html.Node): void; canApply(name: string): boolean; @@ -621,17 +631,17 @@ export class Formatter implements Formatter { constructor(ed: Editor); } -interface Shortcuts { +export interface Shortcuts { add(pattern: string, desc: string, cmdFunc: () => void | string, scope?: {}): boolean; remove(pattern: string): boolean; } -interface Theme { +export interface Theme { renderUI(obj: {}): {}; } -interface UndoManager { +export interface UndoManager { add(level?: {}, event?: DocumentEvent): {}; beforeChange(): void; @@ -651,7 +661,7 @@ interface UndoManager { undo(): {}; } -interface WindowManager { +export interface WindowManager { alert(message: string, callback: () => void, scope?: {}): void; close(): void; @@ -667,7 +677,7 @@ interface WindowManager { setParams(params: {}): void; } -interface notificationManager { +export interface notificationManager { close(): void; getNotifications(): Array<{}>; diff --git a/types/tinymce/tinymce-tests.ts b/types/tinymce/tinymce-tests.ts index 45be7c878a..921edffaea 100644 --- a/types/tinymce/tinymce-tests.ts +++ b/types/tinymce/tinymce-tests.ts @@ -7,8 +7,14 @@ tinymce.init({ plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', - 'insertdatetime media table contextmenu paste code' + 'insertdatetime media table contextmenu paste code', + 'autosave' ], + autosave_ask_before_unload: false, + autosave_interval: "20s", + autosave_prefix: "tinymce-autosave-{path}{query}-{id}-", + autosave_restore_when_empty: false, + autosave_retention: "30m", toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', content_css: '//www.tinymce.com/css/codepen.min.css' });