/** * An IterableIterator that iterates a DataBuffer from startIndex to endIndex with an optional filter. * @internal */ export declare class DataBufferView implements IterableIterator { private data; private index; private size; private endIndex; private length; private normalizedIndex; private filterCallback?; constructor(data: T[], size: number, startIndex: number, endIndex: number, length: number, filter?: (value: T) => boolean); next(): IteratorResult; findIndex(filter: (value: T) => boolean): number; /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. */ slice(start: number, end?: number): IterableIterator; /** * Returns an iterator of a section of this buffer. * @param filter - An optional callback filter. */ filter(filter: (value: T) => boolean): IterableIterator; /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. * @param filter - An optional callback filter. */ sliceAndFilter(start: number, end?: number, filter?: (value: T) => boolean): IterableIterator; [Symbol.iterator](): IterableIterator; } /** * A read-only data buffer. */ interface ReadOnlyDataBuffer extends Iterable { length: number; /** * Takes an integer value and returns the item at that index, * allowing for positive and negative integers. * Negative integers count back from the last item in the array. */ at(index: number): T | undefined; } /** * A read-only data buffer. * @internal */ export type IReadOnlyDataBuffer = ReadOnlyDataBuffer; /** * Holds a data in a ring-buffer. * @internal */ export default class DataBuffer implements IReadOnlyDataBuffer { length: number; private size; private startIndex; private endIndex; private data; /** * Constructor. * @param size - An optional buffer size. */ constructor(size?: number); /** * Clears this DataBuffer. * @param size - An optional new buffer size. */ clear(size?: number): void; /** * Adds data to this DataBuffer. * @param elements - The new elements. */ push(...elements: T[]): void; /** * Takes an integer value and returns the item at that index, * allowing for positive and negative integers. * Negative integers count back from the last item in the array. */ at(index: number): T | undefined; /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. */ slice(start: number, end?: number): DataBufferView; /** * Returns an iterator of a section of this buffer. * @param filter - An optional callback filter. */ filter(filter: (value: T) => boolean): DataBufferView; /** * Returns an iterator of a section of this buffer. * @param start - The beginning index of the specified portion of the buffer. * @param end - The end index of the specified portion of the buffer. This is exclusive of the element at the index 'end'. * If end is undefined, then the slice extends to the end of the buffer. * @param filter - An optional callback filter. */ sliceAndFilter(start: number, end?: number, filter?: (value: T) => boolean): DataBufferView; view(): DataBufferView; [Symbol.iterator](): IterableIterator; } export {};