snapper-consumer
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -6,3 +6,3 @@ { | ||
"typings": "./snapper-consumer.d.ts", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"authors": [ | ||
@@ -14,7 +14,7 @@ "Yan Qing <admin@zensh.com>" | ||
"dependencies": { | ||
"engine.io-client": "~1.6.9", | ||
"jsonrpc-lite": "~1.2.1" | ||
"engine.io-client": "~1.6.11", | ||
"jsonrpc-lite": "~1.2.3" | ||
}, | ||
"devDependencies": { | ||
"standard": "^7.1.1" | ||
"standard": "^7.1.2" | ||
}, | ||
@@ -21,0 +21,0 @@ "scripts": { |
@@ -0,3 +1,16 @@ | ||
export interface RequestObject { | ||
id: number; | ||
jsonrpc: string; | ||
method: 'publish' | 'notification' | 'success' | 'error' | 'invalid'; | ||
params: string[]; | ||
} | ||
export interface RequestEvent { | ||
id: number; | ||
type: 'request' | 'invalid' | 'notification' | 'success' | 'error'; | ||
data: RequestObject; | ||
} | ||
export default class Consumer { | ||
constructor(url: string, options: { | ||
constructor(url?: string, options?: { | ||
token: string; | ||
@@ -9,13 +22,14 @@ query: string; | ||
onclose: Function; | ||
onerror(err: Error): any; | ||
onmessage(event: string): any; | ||
onerror(err: Error): void; | ||
onmessage(event: RequestEvent): void; | ||
request(method: string, params: { | ||
[index: string]: any | ||
} | any[], callback: (err: Error, res: any) => any): Consumer; | ||
join(room: string): Consumer; | ||
join(room?: string): Consumer; | ||
_join(roomId: string, consumerId: string): any; | ||
_respond(event: string): void; | ||
connect(url: string, options: { | ||
connect(url: string, options?: { | ||
token: string; | ||
query: string; | ||
path?: string; | ||
query?: string; | ||
[index: string]: any; | ||
@@ -22,0 +36,0 @@ }): Consumer; |
10761
197
Updatedengine.io-client@~1.6.11
Updatedjsonrpc-lite@~1.2.3