Skip to content

Commit

Permalink
Merge pull request #34 from onivim/bryphe/notification-overlays-api
Browse files Browse the repository at this point in the history
API: Add notification and overlay API
  • Loading branch information
bryphe authored Mar 12, 2018
2 parents 70ea622 + 5ce3806 commit 0828ad0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
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.39",
"version": "0.0.40",
"description": "Oni's API layer",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
40 changes: 40 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,44 @@ export interface Configuration {
setValues(configurationValues: ConfigurationValues): void
}

export namespace Notifications {

export interface Notification {
onClick: IEvent<void>
onClose: IEvent<void>

setContents(title: string, detail: string): void
setExpiration(expirationTimeInMilliseconds: number): void

show(): void
hide(): void
}

export interface Api {
enable(): void
disable(): void

createItem(): Notification
}
}

export namespace Overlays {
/**
* An overlay is a full-screen UI element,
* that renders above the editor layer.
*/
export interface Overlay {
hide(): void
show(): void

setContents(element: JSX.Element): void
}

export interface Api {
createItem(): Overlay
}
}

export interface Workspace {
onDirectoryChanged: IEvent<string>
}
Expand Down Expand Up @@ -636,6 +674,8 @@ export namespace Plugin {
input: Input.InputManager
language: any /* TODO */
log: any /* TODO */
notifications: Notifications.Api
overlays: Overlays.Api
plugins: IPluginManager
menu: Menu.Api
process: Process
Expand Down

0 comments on commit 0828ad0

Please sign in to comment.