64 lines
No EOL
2.1 KiB
TypeScript
64 lines
No EOL
2.1 KiB
TypeScript
/**
|
|
* @module botframework-streaming
|
|
*/
|
|
/**
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
import { SubscribableStream } from '../subscribableStream';
|
|
import { StreamManager, PayloadTypes } from '../payloads';
|
|
import { IAssemblerParams, IHeader } from '../interfaces';
|
|
/**
|
|
* Assembles payloads for streaming library.
|
|
*
|
|
* @internal
|
|
*/
|
|
export declare class PayloadAssembler {
|
|
private readonly streamManager;
|
|
id: string;
|
|
end: boolean;
|
|
contentLength: number;
|
|
payloadType: string | PayloadTypes;
|
|
private stream;
|
|
private readonly _onCompleted;
|
|
private readonly _byteOrderMark;
|
|
private readonly _utf;
|
|
/**
|
|
* Initializes a new instance of the [PayloadAssembler](xref:botframework-streaming.PayloadAssembler) class.
|
|
*
|
|
* @param streamManager The [StreamManager](xref:botframework-streaming.StreamManager) managing the stream being assembled.
|
|
* @param params Parameters for a streaming assembler.
|
|
*/
|
|
constructor(streamManager: StreamManager, params: IAssemblerParams);
|
|
/**
|
|
* Retrieves the assembler's payload as a stream.
|
|
*
|
|
* @returns A [SubscribableStream](xref:botframework-streaming.SubscribableStream) of the assembler's payload.
|
|
*/
|
|
getPayloadStream(): SubscribableStream;
|
|
/**
|
|
* The action the assembler executes when new bytes are received on the incoming stream.
|
|
*
|
|
* @param header The stream's Header.
|
|
* @param stream The incoming stream being assembled.
|
|
* @param _contentLength The length of the stream, if finite.
|
|
*/
|
|
onReceive(header: IHeader, stream: SubscribableStream, _contentLength: number): void;
|
|
/**
|
|
* Closes the assembler.
|
|
*/
|
|
close(): void;
|
|
/**
|
|
* Creates a new [SubscribableStream](xref:botframework-streaming.SubscribableStream) instance.
|
|
*
|
|
* @returns The new stream ready for consumption.
|
|
*/
|
|
private createPayloadStream;
|
|
private payloadFromJson;
|
|
private stripBOM;
|
|
private process;
|
|
private processResponse;
|
|
private processRequest;
|
|
private processStreams;
|
|
}
|
|
//# sourceMappingURL=payloadAssembler.d.ts.map
|