botframework-streaming
Version:
Streaming library for the Microsoft Bot Framework
52 lines • 1.85 kB
TypeScript
/**
* @module botframework-streaming
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { IHeader, INodeBuffer } from '../interfaces';
/**
* Streaming header serializer
*/
export declare class HeaderSerializer {
static readonly Delimiter = ".";
static readonly Terminator = "\n";
static readonly End = "1";
static readonly NotEnd = "0";
static readonly TypeOffset: number;
static readonly TypeDelimiterOffset = 1;
static readonly LengthOffset = 2;
static readonly LengthLength = 6;
static readonly LengthDelimeterOffset = 8;
static readonly IdOffset = 9;
static readonly IdLength = 36;
static readonly IdDelimeterOffset = 45;
static readonly EndOffset = 46;
static readonly TerminatorOffset = 47;
static readonly Encoding = "utf8";
/**
* Serializes the header into a buffer
*
* @param header The header to serialize.
* @param buffer The buffer into which to serialize the header.
*/
static serialize(header: IHeader, buffer: INodeBuffer): void;
/**
* Deserializes a buffer containing header information.
*
* @param buffer The buffer from which to obtain the data to deserialize.
* @returns The deserialized header from the buffer.
*/
static deserialize(buffer: INodeBuffer): IHeader;
/**
* Creates a padded string based on a length and character to be padded to.
*
* @param lengthValue The value to be assingned on the result.
* @param totalLength The length of the padded string result.
* @param padChar The character value to use as filling.
* @returns The padded string.
*/
static headerLengthPadder(lengthValue: number, totalLength: number, padChar: string): string;
}
//# sourceMappingURL=headerSerializer.d.ts.map