@bfchain/bnrtc2-client-typings
Advanced tools
Comparing version 0.0.1-alpha.8 to 0.0.1-alpha.9
@@ -6,2 +6,5 @@ /// <reference lib="dom" /> | ||
isOnline(address: string): Promise<boolean>; | ||
addPeers(hosts: string[]): Promise<boolean>; | ||
deletePeers(hosts: string[]): Promise<boolean>; | ||
getPeers(): Promise<string[]>; | ||
} | ||
@@ -13,4 +16,4 @@ interface Bnrtc2Client { | ||
send(address: string, dport: string, data: Bnrtc2.Bnrtc2Buffer | Uint8Array): Promise<void>; | ||
onData(dport: string, handler: Bnrtc2DataHandler): void; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): void; | ||
onData(dport: string, handler: Bnrtc2DataHandler): Promise<void>; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): Promise<void>; | ||
} | ||
@@ -17,0 +20,0 @@ type Bnrtc2DataHandler = (data: Bnrtc2Data) => void; |
@@ -14,3 +14,5 @@ export declare const enum READY_STATE { | ||
DPORT_UNBOUND = 4, | ||
TIMEOUT = 5 | ||
CONNECT_FAILED = 5, | ||
FORMAT_ERR = 6, | ||
TIMEOUT = 7 | ||
} | ||
@@ -17,0 +19,0 @@ export declare const enum SEND_DATA_TYPE { |
@@ -6,2 +6,5 @@ /// <reference lib="dom" /> | ||
isOnline(address: string): Promise<boolean>; | ||
addPeers(hosts: string[]): Promise<boolean>; | ||
deletePeers(hosts: string[]): Promise<boolean>; | ||
getPeers(): Promise<string[]>; | ||
} | ||
@@ -13,4 +16,4 @@ interface Bnrtc2Client { | ||
send(address: string, dport: string, data: Bnrtc2.Bnrtc2Buffer | Uint8Array): Promise<void>; | ||
onData(dport: string, handler: Bnrtc2DataHandler): void; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): void; | ||
onData(dport: string, handler: Bnrtc2DataHandler): Promise<void>; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): Promise<void>; | ||
} | ||
@@ -17,0 +20,0 @@ type Bnrtc2DataHandler = (data: Bnrtc2Data) => void; |
@@ -14,3 +14,5 @@ export declare const enum READY_STATE { | ||
DPORT_UNBOUND = 4, | ||
TIMEOUT = 5 | ||
CONNECT_FAILED = 5, | ||
FORMAT_ERR = 6, | ||
TIMEOUT = 7 | ||
} | ||
@@ -17,0 +19,0 @@ export declare const enum SEND_DATA_TYPE { |
@@ -6,2 +6,5 @@ /// <reference lib="dom" /> | ||
isOnline(address: string): Promise<boolean>; | ||
addPeers(hosts: string[]): Promise<boolean>; | ||
deletePeers(hosts: string[]): Promise<boolean>; | ||
getPeers(): Promise<string[]>; | ||
} | ||
@@ -13,4 +16,4 @@ interface Bnrtc2Client { | ||
send(address: string, dport: string, data: Bnrtc2.Bnrtc2Buffer | Uint8Array): Promise<void>; | ||
onData(dport: string, handler: Bnrtc2DataHandler): void; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): void; | ||
onData(dport: string, handler: Bnrtc2DataHandler): Promise<void>; | ||
offData(dport: string, handler?: Bnrtc2DataHandler): Promise<void>; | ||
} | ||
@@ -17,0 +20,0 @@ type Bnrtc2DataHandler = (data: Bnrtc2Data) => void; |
@@ -14,3 +14,5 @@ export declare const enum READY_STATE { | ||
DPORT_UNBOUND = 4, | ||
TIMEOUT = 5 | ||
CONNECT_FAILED = 5, | ||
FORMAT_ERR = 6, | ||
TIMEOUT = 7 | ||
} | ||
@@ -17,0 +19,0 @@ export declare const enum SEND_DATA_TYPE { |
{ | ||
"name": "@bfchain/bnrtc2-client-typings", | ||
"version": "0.0.1-alpha.8", | ||
"version": "0.0.1-alpha.9", | ||
"main": "cjs/index.js", | ||
@@ -9,4 +9,4 @@ "type": "cjs/index.d.ts", | ||
"dependencies": { | ||
"@bfchain/bnrtc2-buffer": "^0.0.1-alpha.8" | ||
"@bfchain/bnrtc2-buffer": "^0.0.1-alpha.9" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12290
237