From e9ef628db031048c474ad5ab35afe0ba7e0a52e8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 23 Oct 2017 14:56:45 -0700 Subject: [PATCH] Revert "Remove and deprecate `status-bar` (#20727)" This reverts commit c05fef4faf439d6ea0672c513b53b223fbaed0be. --- types/status-bar/README.md | 1 + types/status-bar/index.d.ts | 33 ++++++++++++++++++++++++++++ types/status-bar/status-bar-tests.ts | 8 +++++++ types/status-bar/tsconfig.json | 24 ++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 types/status-bar/README.md create mode 100644 types/status-bar/index.d.ts create mode 100644 types/status-bar/status-bar-tests.ts create mode 100644 types/status-bar/tsconfig.json diff --git a/types/status-bar/README.md b/types/status-bar/README.md new file mode 100644 index 0000000000..91b72cc583 --- /dev/null +++ b/types/status-bar/README.md @@ -0,0 +1 @@ +***NOTE:*** *This package is deprecated and new versions have been merged into [`@types/atom`](https://www.npmjs.com/package/@types/atom). The most recent version can be accessed as part of the `Atom.Services` namespace.* diff --git a/types/status-bar/index.d.ts b/types/status-bar/index.d.ts new file mode 100644 index 0000000000..116e045dbe --- /dev/null +++ b/types/status-bar/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for status-bar +// Project: https://github.com/atom/status-bar +// Definitions by: vvakame +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// +/// + +declare namespace StatusBar { + interface IStatusBarViewStatic { + content():any; + + new(...args:any[]):IStatusBarView; + } + + interface IStatusBarView extends View { + + initialize():any; + attach():any; + destroy():any; + appendLeft(view:View):any; + prependLeft(view:View):any; + appendRight(view:View):any; + prependRight(view:View):any; + getActiveBuffer():TextBuffer.ITextBuffer; + getActiveItem():any; + storeActiveBuffer():TextBuffer.ITextBuffer; + subscribeToBuffer(event:string, callback:Function):any; + subscribeAllToBuffer():any[]; + unsubscribeAllFromBuffer():any[]; + } +} diff --git a/types/status-bar/status-bar-tests.ts b/types/status-bar/status-bar-tests.ts new file mode 100644 index 0000000000..7a1448b9ec --- /dev/null +++ b/types/status-bar/status-bar-tests.ts @@ -0,0 +1,8 @@ + + +declare var StatusBarView:StatusBar.IStatusBarViewStatic; + +StatusBarView.content(); + +var statusBar = new StatusBarView(); +statusBar.appendLeft(new View()); diff --git a/types/status-bar/tsconfig.json b/types/status-bar/tsconfig.json new file mode 100644 index 0000000000..14756934ad --- /dev/null +++ b/types/status-bar/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "status-bar-tests.ts" + ] +} \ No newline at end of file