Skip to content

Commit aadd63e

Browse files
committed
Merge pull request DefinitelyTyped#4421 from borisyankov/basarat-patch-1
feat(ace) specialize 'change'
2 parents 48db77e + 9a8c0ea commit aadd63e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ace/ace.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,10 @@ declare module AceAjax {
10341034
* Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
10351035
**/
10361036
export interface Editor {
1037-
1038-
addEventListener(ev: string, callback: Function);
10391037

1038+
addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any);
1039+
addEventListener(ev: string, callback: Function);
1040+
10401041
inMultiSelectMode: boolean;
10411042

10421043
selectMoreLines(n: number);
@@ -1712,6 +1713,13 @@ declare module AceAjax {
17121713
**/
17131714
new(renderer: VirtualRenderer, session?: IEditSession): Editor;
17141715
}
1716+
1717+
interface EditorChangeEvent {
1718+
start: Position;
1719+
end: Position;
1720+
action: string; // insert, remove
1721+
lines: any[];
1722+
}
17151723

17161724
////////////////////////////////
17171725
/// PlaceHolder

0 commit comments

Comments
 (0)