mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
add more typings between 5.1 and 6.0
This commit is contained in:
17
types/ws/index.d.ts
vendored
17
types/ws/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ws 5.1
|
||||
// Type definitions for ws 6.0
|
||||
// Project: https://github.com/websockets/ws
|
||||
// Definitions by: Paul Loyd <https://github.com/loyd>
|
||||
// Matt Silverlock <https://github.com/elithrar>
|
||||
@@ -120,7 +120,7 @@ declare namespace WebSocket {
|
||||
* whether or not to accept the handshake.
|
||||
*/
|
||||
type VerifyClientCallbackAsync = (info: { origin: string; secure: boolean; req: http.IncomingMessage }
|
||||
, callback: (res: boolean, code?: number, message?: string) => void) => void;
|
||||
, callback: (res: boolean, code?: number, message?: string, headers?: http.OutgoingHttpHeaders) => void) => void;
|
||||
|
||||
interface ClientOptions {
|
||||
protocol?: string;
|
||||
@@ -149,8 +149,17 @@ declare namespace WebSocket {
|
||||
clientNoContextTakeover?: boolean;
|
||||
serverMaxWindowBits?: number;
|
||||
clientMaxWindowBits?: number;
|
||||
level?: number;
|
||||
memLevel?: number;
|
||||
zlibDeflateOptions?: {
|
||||
flush?: number;
|
||||
finishFlush?: number;
|
||||
chunkSize?: number;
|
||||
windowBits?: number;
|
||||
level?: number;
|
||||
memLevel?: number;
|
||||
strategy?: number;
|
||||
dictionary?: Buffer | Buffer[] | DataView;
|
||||
info?: boolean;
|
||||
};
|
||||
threshold?: number;
|
||||
concurrencyLimit?: number;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,20 @@ import * as https from 'https';
|
||||
clientNoContextTakeover: true,
|
||||
serverMaxWindowBits: 0,
|
||||
clientMaxWindowBits: 0,
|
||||
memLevel: 0
|
||||
zlibDeflateOptions: {
|
||||
flush: 0,
|
||||
finishFlush: 0,
|
||||
chunkSize: 0,
|
||||
windowBits: 0,
|
||||
level: 0,
|
||||
memLevel: 0,
|
||||
strategy: 0,
|
||||
dictionary: new Buffer('test'),
|
||||
info: false
|
||||
}
|
||||
},
|
||||
verifyClient: (info: any, cb: any) => {
|
||||
cb(true, 123, 'message', { Upgrade: "websocket" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user