UNPKG

botframework-streaming

Version:

Streaming library for the Microsoft Bot Framework

51 lines 2.05 kB
/** * @module botframework-streaming */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { PayloadTypes } from '../payloads'; import { PayloadSender } from '../payloadTransport'; import { IStreamWrapper } from '../interfaces'; /** * Base class streaming payload disassembling. */ export declare abstract class PayloadDisassembler { private readonly sender; private readonly id; abstract payloadType: PayloadTypes; private stream; private streamLength?; /** * Initializes a new instance of the [PayloadDisassembler](xref:botframework-streaming.PayloadDisassembler) class. * * @param sender The [PayloadSender](xref:botframework-streaming.PayloadSender) used to send the disassembled payload chunks. * @param id The ID of this disassembler. */ constructor(sender: PayloadSender, id: string); /** * Serializes the item into the [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) that exposes the stream and length of the result. * * @param item The item to be serialized. * @returns The stream containing the serialized item and the length of the stream. */ protected static serialize<T>(item: T): IStreamWrapper; /** * Gets the stream this disassembler is operating on. * * @returns An [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) with a Subscribable Stream. */ abstract getStream(): Promise<IStreamWrapper>; /** * Begins the process of disassembling a payload and sending the resulting chunks to the [PayloadSender](xref:botframework-streaming.PayloadSender) to dispatch over the transport. * * @returns A completed Promise after the disassembled payload has been sent. */ disassemble(): Promise<void>; /** * Begins the process of disassembling a payload and signals the [PayloadSender](xref:botframework-streaming.PayloadSender). */ private send; } //# sourceMappingURL=payloadDisassembler.d.ts.map