From 5ce3806a82adfc9f6d966f49d53791279e1953eb Mon Sep 17 00:00:00 2001 From: Bryan Phelps Date: Mon, 12 Mar 2018 07:44:11 -0700 Subject: [PATCH] Update package --- package.json | 2 +- src/index.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c6b64d3..54744ca 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 0c4cb7d..79f80a8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,6 +43,44 @@ export interface Configuration { setValues(configurationValues: ConfigurationValues): void } +export namespace Notifications { + + export interface Notification { + onClick: IEvent + onClose: IEvent + + 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 } @@ -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