massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-jsonrpc / lib / common / events.d.ts
1 import { Disposable } from './disposable';
2 /**
3  * Represents a typed event.
4  */
5 export interface Event<T> {
6     /**
7      *
8      * @param listener The listener function will be call when the event happens.
9      * @param thisArgs The 'this' which will be used when calling the event listener.
10      * @param disposables An array to which a {{IDisposable}} will be added. The
11      * @return
12     */
13     (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
14 }
15 export declare namespace Event {
16     const None: Event<any>;
17 }
18 export interface EmitterOptions {
19     onFirstListenerAdd?: Function;
20     onLastListenerRemove?: Function;
21 }
22 export declare class Emitter<T> {
23     private _options?;
24     private static _noop;
25     private _event;
26     private _callbacks;
27     constructor(_options?: EmitterOptions | undefined);
28     /**
29      * For the public to allow to subscribe
30      * to events from this Emitter
31      */
32     get event(): Event<T>;
33     /**
34      * To be kept private to fire an event to
35      * subscribers
36      */
37     fire(event: T): any;
38     dispose(): void;
39 }