rtp.js
Version:
RTP stack for Node.js and browser written in TypeScript
111 lines • 2.62 kB
TypeScript
/**
* Clones the given object/array/Buffer/etc.
*
* @category Utils
* @hidden
*/
export declare function clone<T>(data: T): T;
/**
* TypeScript utility to assert that no `case X` is missing in a `switch()`
* block.
*
* @category Utils
* @hidden
*/
export declare function assertUnreachable(_x: never): never;
/**
* Returns the given size padded to 4 bytes.
*
* @category Utils
*/
export declare function padTo4Bytes(size: number): number;
/**
* Whether two DataViews contain the same data.
*
* @category Utils
* @hidden
*/
export declare function areDataViewsEqual(view1: DataView, view2: DataView): boolean;
/**
* Convert Node.js Buffer to DataView using the same underlying ArrayBuffer.
*
* @category Utils
* @remarks
* - Just for Node.js.
*/
export declare function nodeBufferToDataView(nodeBuffer: Buffer): DataView;
/**
* Convert DataView to Node.js Buffer using the same underlying ArrayBuffer.
*
* @category Utils
* @remarks
* - Just for Node.js.
*/
export declare function dataViewToNodeBuffer(view: DataView): Buffer;
/**
* Convert Node.js Buffer to a new allocated ArrayBufferLike.
*
* @category Utils
* @remarks
* - Just for Node.js.
*/
export declare function nodeBufferToArrayBuffer(nodeBuffer: Buffer): ArrayBufferLike;
/**
* Convert ArrayBufferLike to Node.js Buffer.
*
* @category Utils
* @remarks
* - Just for Node.js.
*/
export declare function arrayBufferToNodeBuffer(arrayBuffer: ArrayBufferLike): Buffer;
/**
* Convert array of integers to DataView.
*
* @category Utils
*/
export declare function numericArrayToDataView(array: number[]): DataView;
/**
* Convert number to DataView.
*
* @category Utils
*/
export declare function numberToDataView(number: number): DataView;
/**
* Convert DataView to string.
*
* @category Utils
*/
export declare function dataViewToString(view: DataView): string;
/**
* Convert ArrayBuffer to string.
*
* @category Utils
*/
export declare function arrayBufferToString(arrayBuffer: ArrayBuffer): string;
/**
* Convert string to DataView.
*
* @category Utils
*/
export declare function stringToDataView(string: string): DataView;
/**
* Convert string to ArrayBufferLike.
*
* @category Utils
* @hidden
*/
export declare function stringToArrayBuffer(string: string): ArrayBufferLike;
/**
* Convert string to Uint8Array.
*
* @category Utils
* @hidden
*/
export declare function stringToUint8Array(string: string): Uint8Array;
/**
* Get the byte length of a string.
*
* @category Utils
*/
export declare function getStringByteLength(string: string): number;
//# sourceMappingURL=helpers.d.ts.map