-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor] unified event handling of program input and user input by …
…introducing `IEditorInputEmulator`
- Loading branch information
Showing
5 changed files
with
145 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { IOnTextInputEvent } from "src/editor/view/proseEventBroadcaster"; | ||
|
||
|
||
/** | ||
* A delegate to simulate certain user's input programmatically. | ||
* | ||
* Consider the following difference: | ||
* 1. The workflow of user input might be: | ||
* Keyboard Event -> Event Broadcasting -> Extension Handing -> Document Updates | ||
* 2. The workflow of program input: | ||
* function call -> Document Updates | ||
* | ||
* This is a problem for program input, the event is not broadcasting, so the | ||
* extensions and others cannot be notified. | ||
* | ||
* This why we need a delegate to emulate related-functions by also broadcasting | ||
* them. | ||
*/ | ||
export interface IEditorInputEmulator { | ||
type(event: IOnTextInputEvent): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters