Skip to content

Commit

Permalink
Merge pull request #22 from onivim/bryphe/editor/any-editor-api
Browse files Browse the repository at this point in the history
Editor API: Introduce 'anyEditor' concept
  • Loading branch information
bryphe authored Feb 23, 2018
2 parents d9bddea + dbd87c5 commit f4ea629
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oni-api",
"version": "0.0.31",
"version": "0.0.32",
"description": "Oni's API layer",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
23 changes: 22 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,29 @@ export interface IWindowSplit {
}

export interface EditorManager {
allEditors: Editor

/**
* An array of all available `Editor` instances
*/
allEditors: Editor[]

/**
* A proxy that _always_ points to the active `Editor`. This means
* you can avoid always needing to hook/unhook events when the
* active `Editor` changes by hooking events on `anyEditor`
*/
anyEditor: Editor

/**
* The currently active `Editor` instance
*/
activeEditor: Editor

/**
* Event that is dispatched when the active `Editor` changes,
* for example, when focus moves from one `Editor` to another.
*/
onActiveEditorChanged: IEvent<Editor>
}

export interface InputManager {
Expand Down

0 comments on commit f4ea629

Please sign in to comment.