~glacambre/firenvim

ref: 1da57aaa445fa2d74099c9223c5ee238f0ca25fb firenvim/src/firenvim.d.ts -rw-r--r-- 706 bytes
1da57aaaglacambre Create stub that compiles and correctly requires files. 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
declare class WebextensionEventTarget {
    addListener(f: Function): void;
    removeListener(f: Function): void;
}

declare class RuntimeOnConnect extends WebextensionEventTarget{}

declare class PortError {
    message: string;
}

declare class PortOnDisconnect extends WebextensionEventTarget{}

declare class PortOnMessage extends WebextensionEventTarget{}

declare class Port {
    name: string;
    disconnect(): void;
    error: PortError;
    onDisconnect: PortOnDisconnect;
    onMessage: PortOnMessage;
    postMessage(msg: string): void;
}

declare namespace browser.runtime {
    function connect(): Port;
    function connectNative(name: string): Port;
    let onConnect: RuntimeOnConnect;
}