/** * A lightweight buffer implementation that have limited functionalities include * basic data reading and writing in lightweight usage. * */ export declare class DataBuffer { readonly buffer: Uint8Array; private constructor(); get length(): number; get byteLength(): number; static isDataBuffer(obj: any): obj is DataBuffer; /** * When running in a nodejs context, the backing store for the returned `DataBuffer` instance * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferable. */ static alloc(byteLength: number): DataBuffer; /** * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for * the returned `DataBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool, * which is not transferable. */ static wrap(actual: Uint8Array): DataBuffer; /** * When running in a nodejs context, the backing store for the returned `DataBuffer` instance * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferable. */ static fromString(source: string, options?: { dontUseNodeBuffer?: boolean; }): DataBuffer; /** * When running in a nodejs context, the backing store for the returned `DataBuffer` instance * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferable. */ static fromByteArray(source: number[]): DataBuffer; /** * When running in a nodejs context, the backing store for the returned `DataBuffer` instance * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferable. */ static concat(buffers: DataBuffer[], totalLength?: number): DataBuffer; /** * When running in a nodejs context, the backing store for the returned `DataBuffer` instance * might use a nodejs Buffer allocated from node's Buffer pool, which is not transferable. */ clone(): DataBuffer; toString(): string; slice(start?: number, end?: number): DataBuffer; set(array: DataBuffer | Uint8Array | ArrayBuffer | ArrayBufferView, offset?: number): void; copy(target: DataBuffer, targetStart?: number, start?: number, end?: number): number; indexOf(val: string | number | DataBuffer, byteOffset: number, encoding?: string): number; lastIndexOf(val: string | number | DataBuffer, byteOffset: number, encoding?: string): number; readUInt32BE(offset: number): number; writeUInt32BE(value: number, offset: number): void; readUInt32LE(offset: number): number; writeUInt32LE(value: number, offset: number): void; readUInt16LE(offset: number): number; writeUInt16LE(value: number, offset: number): void; readUInt16BE(offset: number): number; writeUInt16BE(value: number, offset: number): void; readUInt8(offset: number): number; writeUInt8(value: number, offset: number): void; } export declare function readUInt16BE(source: Uint8Array, offset: number): number; export declare function writeUInt16BE(destination: Uint8Array, value: number, offset: number): void; export declare function readUInt16LE(source: Uint8Array, offset: number): number; export declare function writeUInt16LE(destination: Uint8Array, value: number, offset: number): void; export declare function readUInt32BE(source: Uint8Array, offset: number): number; export declare function writeUInt32BE(destination: Uint8Array, value: number, offset: number): void; export declare function readUInt32LE(source: Uint8Array, offset: number): number; export declare function writeUInt32LE(destination: Uint8Array, value: number, offset: number): void; export declare function readUInt8(source: Uint8Array, offset: number): number; export declare function writeUInt8(destination: Uint8Array, value: number, offset: number): void; /** Decodes base64 to a uint8 array. URL-encoded and unpadded base64 is allowed. */ export declare function decodeBase64(encoded: string): DataBuffer; /** Encodes a buffer to a base64 string. */ export declare function encodeBase64({ buffer }: DataBuffer, padded?: boolean, urlSafe?: boolean): string;