mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Add CodeMirror DOM events (#18824)
* Support the 'copy' event * Make it generic over DOM events
This commit is contained in:
committed by
Mohamed Hegazy
parent
111df1541b
commit
84e67a17f6
Vendored
+6
@@ -102,6 +102,8 @@ declare namespace CodeMirror {
|
||||
To fire your own events, use CodeMirror.signal(target, name, args...), where target is a non-DOM-node object. */
|
||||
function signal(target: any, name: string, ...args: any[]): void;
|
||||
|
||||
type DOMEvent = 'mousedown' | 'dblclick' | 'touchstart' | 'contextmenu' | 'keydown' | 'keypress' | 'keyup' | 'cut' | 'copy' | 'paste' | 'dragstart' | 'dragenter' | 'dragover' | 'dragleave' | 'drop';
|
||||
|
||||
interface Editor {
|
||||
|
||||
/** Tells you whether the editor currently has focus. */
|
||||
@@ -405,6 +407,10 @@ declare namespace CodeMirror {
|
||||
on(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => void ): void;
|
||||
off(eventName: 'renderLine', handler: (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => void ): void;
|
||||
|
||||
/** Fires when one of the DOM events fires. */
|
||||
on(eventName: DOMEvent, handler: (instance: CodeMirror.Editor, event: Event) => void ): void;
|
||||
off(eventName: DOMEvent, handler: (instance: CodeMirror.Editor, event: Event) => void ): void;
|
||||
|
||||
/** Expose the state object, so that the Editor.state.completionActive property is reachable*/
|
||||
state: any;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user