import { ClassForEach } from './internal/decorator'; export declare class Slice extends ClassForEach implements Iterable { readonly array: Array; readonly start: number; readonly end: number; /** * Creates a slice attached to the incoming array * @throws TypeError * @throws RangeError */ static attach(a: Array, start?: number, end?: number): Slice; /** * Create a slice * @throws TypeError * @throws RangeError */ static make(length: number, capacity?: number): Slice; private constructor(); /** * Returns the element at index i in the slice * @throws TypeError * @throws RangeError */ get(i: number): T; /** * Sets the element at index i in the slice to val * @throws TypeError * @throws RangeError */ set(i: number, val: T): void; /** * return slice length */ get length(): number; /** * return slice capacity */ get capacity(): number; /** * take sub-slices * @throws TypeError * @throws RangeError */ slice(start?: number, end?: number): Slice; /** * Copy data from src to current slice * @returns How much data was copied */ copy(src: Iterable): number; /** * Add a new element at the end of the slice and return the new slice */ append(...vals: Array): Slice; /** * return js iterator * @param reverse If true, returns an iterator to traverse in reverse * @override */ iterator(reverse?: boolean): Iterator; /** * implements js Iterable * @sealedl */ [Symbol.iterator](): Iterator; /** * Returns an object that implements a js Iterable, but it traverses the data in reverse * @sealed */ get reverse(): Iterable; } /** * Combined into a construct cache */ export declare class StringBuilder { private a; constructor(); write(...vals: Array): void; undo(): string | undefined; toString(): string; } export declare class Bytes extends ClassForEach implements Iterable { readonly buffer: ArrayBuffer; readonly start: number; readonly end: number; /** * Creates a Bytes attached to the incoming ArrayBuffer * @throws TypeError * @throws RangeError */ static attach(b: ArrayBuffer, start?: number, end?: number): Bytes; /** * Create a Bytes * @throws TypeError * @throws RangeError */ static make(length: number, capacity?: number): Bytes; /** * Create a Bytes from string */ static fromString(str: string): Bytes; private constructor(); /** * return bytes length */ get length(): number; /** * return bytes capacity */ get capacity(): number; /** * * return DataView of Bytes * @throws TypeError * @throws RangeError */ dataView(start?: number, end?: number): DataView; /** * return Uint8Array of Bytes * @throws TypeError * @throws RangeError */ data(start?: number, end?: number): Uint8Array; /** * take sub-slices * @throws TypeError * @throws RangeError */ slice(start?: number, end?: number): Bytes; copyBytes(src: Bytes): number; copyArray(src: ArrayLike | ArrayBuffer): number; copyString(src: string): number; private _copy; /** * return js iterator * @param reverse If true, returns an iterator to traverse in reverse * @override */ iterator(reverse?: boolean): Iterator; /** * implements js Iterable * @sealedl */ [Symbol.iterator](): Iterator; /** * Returns an object that implements a js Iterable, but it traverses the data in reverse * @sealed */ get reverse(): Iterable; /** * Add a new element at the end of the slice and return the new slice */ append(...vals: Array): Bytes; appendBytes(...vals: Array): Bytes; appendArray(...vals: Array>): Bytes; appendString(...strs: Array): Bytes; private _appends; private _growSlice; private _append; toString(): string; }