From 1a9fbf4e1e8484ab0d2cce398ae8eff7f1e598c2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 10 May 2014 22:56:58 +0900 Subject: [PATCH] improve atom/atom.d.ts and others. add status-bar/status-bar.d.ts. --- CONTRIBUTORS.md | 1 + atom/atom.d.ts | 5 ++++- space-pen/space-pen.d.ts | 6 +++++- status-bar/status-bar-tests.ts | 8 ++++++++ status-bar/status-bar.d.ts | 32 ++++++++++++++++++++++++++++++++ text-buffer/text-buffer.d.ts | 2 +- 6 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 status-bar/status-bar-tests.ts create mode 100644 status-bar/status-bar.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f17b7788de..a9e9e23e1f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -272,6 +272,7 @@ All definitions files include a header with the author and editors, so at some p * [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev)) * [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) * [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov)) +* [status-bar](https://github.com/atom/status-bar) (by [vvakame](https://github.com/vvakame)) * [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/)) * [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone)) * [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/)) diff --git a/atom/atom.d.ts b/atom/atom.d.ts index b2399515ad..43a682a793 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -8,6 +8,7 @@ /// /// /// +/// // Policy: this definition file only declare element related to `atom`. // if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). @@ -87,6 +88,8 @@ declare module AtomCore { command(eventName:string, selector:Function, handler:Function):any; command(eventName:string, options:any, handler:Function):any; command(eventName:string, selector:Function, options:any, handler:Function):any; + + statusBar:StatusBar.IStatusBarView; } interface IPanes { @@ -661,7 +664,7 @@ declare module AtomCore { getSelectionsOrderedByBufferPosition():ISelection[]; getLastSelectionInBuffer():ISelection; selectionIntersectsBufferRange(bufferRange:any):any; - setCursorScreenPosition(position:any, options:any):any; + setCursorScreenPosition(position:any, options?:any):any; getCursorScreenPosition():TextBuffer.IPoint; getCursorScreenRow():number; setCursorBufferPosition(position:any, options:any):any; diff --git a/space-pen/space-pen.d.ts b/space-pen/space-pen.d.ts index 6921786f05..4e283456b8 100644 --- a/space-pen/space-pen.d.ts +++ b/space-pen/space-pen.d.ts @@ -586,7 +586,11 @@ declare module "space-pen" { end():any; - command(commandName:any, selector:any, options:any, handler:any):any; + command(eventName:string, handler:any):any; + + command(eventName:string, selector:any, handler:any):any; + + command(eventName:string, selector:any, options:any, handler:any):any; preempt(eventName:any, handler:any):any; } diff --git a/status-bar/status-bar-tests.ts b/status-bar/status-bar-tests.ts new file mode 100644 index 0000000000..13e1941b66 --- /dev/null +++ b/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/status-bar/status-bar.d.ts b/status-bar/status-bar.d.ts new file mode 100644 index 0000000000..6c67887205 --- /dev/null +++ b/status-bar/status-bar.d.ts @@ -0,0 +1,32 @@ +// Type definitions for status-bar +// Project: https://github.com/atom/status-bar +// Definitions by: vvakame +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module 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/text-buffer/text-buffer.d.ts b/text-buffer/text-buffer.d.ts index 09066e61d4..9296e7c7c0 100644 --- a/text-buffer/text-buffer.d.ts +++ b/text-buffer/text-buffer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Atom +// Type definitions for text-buffer // Project: https://github.com/atom/text-buffer // Definitions by: vvakame // Definitions: https://github.com/borisyankov/DefinitelyTyped