mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
TinyMCE typings (WIP) (#13728)
* TinyMCE typings * TinyMCE declaration file * Update tsconfig.json Changed `strictNullChecks` to true and added `noImplicitThis` * Update index.d.ts Added namespace * Update index.d.ts
This commit is contained in:
parent
a1cbc2a5dc
commit
ff2d63b83b
44
tinymce/index.d.ts
vendored
Normal file
44
tinymce/index.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
// Type definitions for TinyMCE 4.5
|
||||
// Project: https://github.com/tinymce/tinymce
|
||||
// Definitions by: Martin Duparc <https://github.com/martinduparc/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Work In Progress
|
||||
|
||||
declare namespace TinyMCE {
|
||||
export interface Observable {
|
||||
off: (name?: string, callback?: () => void) => any;
|
||||
on: (name: string, callback: () => void) => any;
|
||||
fire: (name: string, args?: any, bubble?: boolean) => Event;
|
||||
}
|
||||
|
||||
export interface Editor extends Observable {
|
||||
destroy: (automatic: boolean) => void;
|
||||
remove: () => void;
|
||||
hide: () => void;
|
||||
show: () => void;
|
||||
getContent: (args?: any) => string;
|
||||
setContent: (content: string, args?: any) => string;
|
||||
focus: (skip_focus?: boolean) => void;
|
||||
undoManager: UndoManager;
|
||||
settings: any;
|
||||
getDoc: () => Document;
|
||||
editorUpload: any;
|
||||
}
|
||||
|
||||
export interface UndoManager {
|
||||
undo: () => any;
|
||||
clear: () => void;
|
||||
hasUndo: () => boolean;
|
||||
}
|
||||
|
||||
export interface Static extends Observable {
|
||||
init: (settings: any) => void;
|
||||
execCommand: (c: string, u: boolean, v: string) => boolean;
|
||||
activeEditor: Editor;
|
||||
get: (id: string) => Editor;
|
||||
triggerSave: () => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var tinymce: TinyMCE.Static;
|
||||
12
tinymce/tinymce-tests.ts
Normal file
12
tinymce/tinymce-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
tinymce.init(
|
||||
{
|
||||
selector: '.tinymce-editable',
|
||||
height: 145,
|
||||
plugins: [
|
||||
'autolink table contextmenu paste code link textcolor colorpicker image imagetools'
|
||||
],
|
||||
menubar: 'edit insert table tools',
|
||||
toolbar: 'undo redo | styleselect bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | link image',
|
||||
content_css: 'page.css'
|
||||
}
|
||||
);
|
||||
20
tinymce/tsconfig.json
Normal file
20
tinymce/tsconfig.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitThis": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"tinymce-tests.ts"
|
||||
]
|
||||
}
|
||||
1
tinymce/tslint.json
Normal file
1
tinymce/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Loading…
Reference in New Issue
Block a user