/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * Converts a Uint8Array to a string of the provided encoding * Useful when the array might be an {@link IsoBuffer}. * * @param arr - The array to convert. * @param encoding - Optional target encoding; only "utf8" and "base64" are * supported, with "utf8" being default. * @returns The converted string. * * @deprecated Moved to the `@fluidframework-internal/client-utils` package. */ export declare function Uint8ArrayToString(arr: Uint8Array, encoding?: string): string; /** * Converts a {@link https://en.wikipedia.org/wiki/Base64 | base64} or * {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8} string to array buffer. * * @param encoding - The input string's encoding. * * @deprecated Moved to the `@fluidframework-internal/client-utils` package. */ export declare const stringToBuffer: (input: string, encoding: string) => ArrayBufferLike; /** * Convert binary blob to string format * * @param blob - the binary blob * @param encoding - output string's encoding * @returns the blob in string format * * @deprecated Moved to the `@fluidframework-internal/client-utils` package. */ export declare const bufferToString: (blob: ArrayBufferLike, encoding: string) => string; /** * Determines if an object is an array buffer. * * @remarks Will detect and reject TypedArrays, like Uint8Array. * Reason - they can be viewport into Array, they can be accepted, but caller has to deal with * math properly (i.e. Take into account byteOffset at minimum). * For example, construction of new TypedArray can be in the form of new TypedArray(typedArray) or * new TypedArray(buffer, byteOffset, length), but passing TypedArray will result in fist path (and * ignoring byteOffice, length). * * @param obj - The object to determine if it is an ArrayBuffer. * * @deprecated Moved to the `@fluidframework-internal/client-utils` package. */ export declare function isArrayBuffer(obj: any): obj is ArrayBuffer; /** * Minimal implementation of Buffer for our usages in the browser environment. * * @deprecated Moved to the `@fluidframework-internal/client-utils` package. */ export declare class IsoBuffer extends Uint8Array { /** * Convert the buffer to a string. * Only supports encoding the whole string (unlike the Node Buffer equivalent) * and only utf8 and base64 encodings. * * @param encoding - The encoding to use. */ toString(encoding?: string): string; /** * @param value - (string | ArrayBuffer) * @param encodingOrOffset - (string | number) * @param length - (number) */ static from(value: any, encodingOrOffset?: any, length?: any): IsoBuffer; static fromArrayBuffer(arrayBuffer: ArrayBuffer, byteOffset?: number, byteLength?: number): IsoBuffer; static fromString(str: string, encoding?: string): IsoBuffer; static isBuffer(obj: any): boolean; /** * Sanitize a base64 string to provide to base64-js library. * {@link https://www.npmjs.com/package/base64-js} is not as tolerant of the same malformed base64 as Node' * Buffer is. */ private static sanitizeBase64; } //# sourceMappingURL=bufferBrowser.d.ts.map