mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-20 21:12:38 +08:00
Merge pull request #2563 from hellochar/patch-1
Add definitions for fromTextArea methods
This commit is contained in:
14
codemirror/codemirror.d.ts
vendored
14
codemirror/codemirror.d.ts
vendored
@@ -9,7 +9,7 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co
|
||||
declare module CodeMirror {
|
||||
export var Pass: any;
|
||||
|
||||
function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.Editor;
|
||||
function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea;
|
||||
|
||||
var version: string;
|
||||
|
||||
@@ -374,6 +374,18 @@ declare module CodeMirror {
|
||||
on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
|
||||
off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: number, element: HTMLElement) => void ): void;
|
||||
}
|
||||
|
||||
interface EditorFromTextArea extends Editor {
|
||||
|
||||
/** Copy the content of the editor into the textarea. */
|
||||
save(): void;
|
||||
|
||||
/** Remove the editor, and restore the original textarea (with the editor's current content). */
|
||||
toTextArea(): void;
|
||||
|
||||
/** Returns the textarea that the instance was based on. */
|
||||
getTextArea(): HTMLTextAreaElement;
|
||||
}
|
||||
|
||||
class Doc {
|
||||
constructor (text: string, mode?: any, firstLineNumber?: number);
|
||||
|
||||
Reference in New Issue
Block a user