100 lines
2.0 KiB
TypeScript
Raw Normal View History

2023-10-10 22:00:26 +02:00
import { Transport } from "../transport";
export declare class Polling extends Transport {
maxHttpBufferSize: number;
httpCompression: any;
2025-01-25 10:46:42 +01:00
private req;
2023-10-10 22:00:26 +02:00
private res;
private dataReq;
private dataRes;
private shouldClose;
private readonly closeTimeout;
/**
* HTTP polling constructor.
*/
constructor(req: any);
/**
* Transport name
*/
get name(): string;
/**
* Overrides onRequest.
*
* @param req
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
onRequest(req: any): void;
/**
* The client sends a request awaiting for us to send data.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
onPollRequest(req: any, res: any): void;
/**
* The client sends a request with data.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
onDataRequest(req: any, res: any): void;
/**
* Cleanup request.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
private onDataRequestCleanup;
/**
* Processes the incoming data payload.
*
* @param {String} encoded payload
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
onData(data: any): void;
/**
* Overrides onClose.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
onClose(): void;
/**
* Writes a packet payload.
*
* @param {Object} packet
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
send(packets: any): void;
/**
* Writes data as response to poll request.
*
* @param {String} data
* @param {Object} options
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
write(data: any, options: any): void;
/**
* Performs the write.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
doWrite(data: any, options: any, callback: any): void;
/**
* Compresses data.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
compress(data: any, encoding: any, callback: any): void;
/**
* Closes the transport.
*
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
doClose(fn: any): void;
/**
* Returns headers for a response.
*
* @param req - request
* @param {Object} extra headers
2025-01-25 10:46:42 +01:00
* @private
2023-10-10 22:00:26 +02:00
*/
headers(req: any, headers: any): any;
}