Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions types/codemirror/codemirror-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ const a = CodeMirror.findModeByMIME('foo');
const b = CodeMirror.findModeByExtension('foo');
const c = CodeMirror.findModeByFileName('foo');
const d = CodeMirror.findModeByName('foo');
declare var editor: CodeMirror.Editor;
editor.on('cut', (instance, event) => {
event.clipboardData;
});
editor.on('copy', (instance, event) => {
event.clipboardData;
});
editor.on('paste', (instance, event) => {
event.clipboardData;
});
10 changes: 1 addition & 9 deletions types/codemirror/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// koddsson <https://github.com/koddsson>
// ficristo <https://github.com/ficristo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.8
// TypeScript Version: 5.0

export = CodeMirror;
export as namespace CodeMirror;
Expand Down Expand Up @@ -550,20 +550,12 @@ declare namespace CodeMirror {
eventName: K,
handler: (instance: Editor, event: GlobalEventHandlersEventMap[K]) => void,
): void;
on<K extends DOMEvent & keyof DocumentAndElementEventHandlersEventMap>(
eventName: K,
handler: (instance: Editor, event: DocumentAndElementEventHandlersEventMap[K]) => void,
): void;

off<T extends keyof EditorEventMap>(eventName: T, handler: EditorEventMap[T]): void;
off<K extends DOMEvent & keyof GlobalEventHandlersEventMap>(
eventName: K,
handler: (instance: Editor, event: GlobalEventHandlersEventMap[K]) => void,
): void;
off<K extends DOMEvent & keyof DocumentAndElementEventHandlersEventMap>(
eventName: K,
handler: (instance: Editor, event: DocumentAndElementEventHandlersEventMap[K]) => void,
): void;

/** Expose the state object, so that the Editor.state.completionActive property is reachable */
state: any;
Expand Down
2 changes: 1 addition & 1 deletion types/react-codemirror/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Definitions by: Vicky Lai <https://github.com/velveret>
// Rudi Chen <https://github.com/rudi-c>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.8
// TypeScript Version: 5.0

/// <reference types="react"/>
/// <reference types="codemirror"/>
Expand Down