typescript angular-ui-tinymce库的类型定义

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript angular-ui-tinymce库的类型定义相关的知识,希望对你有一定的参考价值。

// Incomplete definitions for http://www.tinymce.com
// Original Source: https://github.com/JayQuerido/typescript-definitions/blob/master/tinymce.d.ts

declare var tinymce: ITinyMceStatic;

interface ITinyMceStatic extends ITinyMceObservable {
    activeEditor: ITinyMceEditor;
    execCommand: (c: string, u: Boolean, v: string) => Boolean;
    get: (id: String) => ITinyMceEditor;
    init: (settings: Object) => void;
}

interface ITinyMceEditor extends ITinyMceObservable {
    destroy: (automatic: boolean) => void;
    focus: (skip_focus?: Boolean) => void;
    getContent: (args?: Object) => string;
    hide: () => void;
    remove: () => void;
    setContent: (content: string, args?: Object) => string;
    settings: ITinyMceOptions;
    show: () => void;
    undoManager: ITinyMceUndoManager;
}

interface ITinyMceObservable {
    off: (name?: string, callback?: Function) => Object;
    on: (name: string, callback: Function) => Object;
    fire: (name: string, args?: Object, bubble?: Boolean) => Event;
}

interface ITinyMceEvent {

}

// Doc Ref: https://www.tinymce.com/docs/configure/
// This list is not currently complete
interface ITinyMceOptions {
    automatic_uploads: boolean;
    body_class: string;
    browser_spellcheck: boolean;
    convert_fonts_to_spans: boolean;
    directionality: string;
    fix_list_elements: boolean;
    gecko_spellcheck: boolean;
    height: number;
    indentation: string;
    insert_toolbar: string;
    invalid_elements: string;
    invalid_styles: string;
    language: string;
    max_height: number;
    max_width: number;
    menu: Object;
    menubar: string | boolean;
    plugins: string;
    preview_styles: boolean;
    remove_trailing_brs: boolean;
    removed_menuitems: string;
    resize: string | boolean;
    selection_toolbar: string;
    selector: string;
    skin: string;
    skin_url: string;
    statusbar: boolean;
    style_formats: ITinyMceStyleFormatItem[];
    style_formats_merge: boolean;
    theme: string;
    theme_url: string;
    toolbar: string;
    toolbar1: string;
    toolbar2: string;
    width: number;
}

interface ITinyMceStyleFormatItem {
    format: string;
    icon: string;
    items: ITinyMceStyleFormatItem[];
    selector: string;
    styles: Object;
    title: string;
}

interface ITinyMceUndoManager {
    clear: () => void;
    hasUndo: () => Boolean;
    undo: () => Object;
}

以上是关于typescript angular-ui-tinymce库的类型定义的主要内容,如果未能解决你的问题,请参考以下文章

TypeScript入门五:TypeScript的接口

TypeScript系列教程--初探TypeScript

TypeScript入门三:TypeScript函数类型

typescript使用 TypeScript 开发 Vue 组件

认识 TypeScript

Learining TypeScript TypeScript 简介