Spaces:
Running
Running
File size: 2,222 Bytes
f9f0fec |
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
/// <reference types="node" />
import { EventEmitter } from "events";
import { IncomingMessage } from "http";
import { Packet } from "engine.io-parser";
declare type ReadyState = "open" | "closing" | "closed";
export declare abstract class Transport extends EventEmitter {
sid: string;
writable: boolean;
protocol: number;
protected _readyState: ReadyState;
protected discarded: boolean;
protected parser: any;
protected req: IncomingMessage & {
cleanup: Function;
};
protected supportsBinary: boolean;
get readyState(): ReadyState;
set readyState(state: ReadyState);
/**
* Transport constructor.
*
* @param {http.IncomingMessage} req
* @api public
*/
constructor(req: any);
/**
* Flags the transport as discarded.
*
* @api private
*/
discard(): void;
/**
* Called with an incoming HTTP request.
*
* @param {http.IncomingMessage} req
* @api protected
*/
protected onRequest(req: any): void;
/**
* Closes the transport.
*
* @api private
*/
close(fn?: any): void;
/**
* Called with a transport error.
*
* @param {String} msg - message error
* @param {Object} desc - 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: Packet): 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;
/**
* Advertise framing support.
*/
abstract get supportsFraming(): any;
/**
* The name of the transport.
*/
abstract get name(): any;
/**
* Sends an array of packets.
*
* @param {Array} packets
* @package
*/
abstract send(packets: any): any;
/**
* Closes the transport.
*/
abstract doClose(fn?: any): any;
}
export {};
|