transport.d.ts
1.8 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/// <reference types="node" />
import { EventEmitter } from "events";
import { IncomingMessage } from "http";
export declare abstract class Transport extends EventEmitter {
sid: string;
writable: boolean;
protocol: number;
protected _readyState: string;
protected discarded: boolean;
protected parser: any;
protected req: IncomingMessage & {
cleanup: Function;
};
protected supportsBinary: boolean;
get readyState(): string;
set readyState(state: string);
/**
* Transport constructor.
*
* @param {http.IncomingMessage} request
* @api public
*/
constructor(req: any);
/**
* Flags the transport as discarded.
*
* @api private
*/
discard(): void;
/**
* Called with an incoming HTTP request.
*
* @param {http.IncomingMessage} request
* @api protected
*/
protected onRequest(req: any): void;
/**
* Closes the transport.
*
* @api private
*/
close(fn?: any): void;
/**
* Called with a transport error.
*
* @param {String} message error
* @param {Object} error description
* @api protected
*/
protected onError(msg: string, desc?: any): void;
/**
* Called with parsed out a packets from the data stream.
*
* @param {Object} packet
* @api protected
*/
protected onPacket(packet: any): void;
/**
* Called with the encoded packet data.
*
* @param {String} data
* @api protected
*/
protected onData(data: any): void;
/**
* Called upon transport close.
*
* @api protected
*/
protected onClose(): void;
abstract get supportsFraming(): any;
abstract get name(): any;
abstract send(packets: any): any;
abstract doClose(fn?: any): any;
}