@tanstack/db
Version:
A reactive client store for building super fast apps on sync
24 lines (23 loc) • 1.24 kB
text/typescript
import { IndexInterface, IndexOperation, IndexReader } from './base-index.cjs';
import { RangeQueryOptions } from './btree-index.cjs';
export declare class ReverseIndex<TKey extends string | number> implements IndexReader<TKey> {
private readonly nullsFirst?;
private originalIndex;
/**
* @param nullsFirst - Whether nullish values come first in the reversed
* order. The original index keeps them at the opposite end, so reversing
* it alone would move them; ordered reads put them back. Omit it to read
* the original index's plain reversed walk, as earlier releases did.
*/
constructor(index: IndexInterface<TKey>, nullsFirst?: boolean | undefined);
lookup(operation: IndexOperation, value: any): Set<TKey>;
rangeQuery(options?: RangeQueryOptions): Set<TKey>;
take(n: number, from: any, filterFn?: (key: TKey) => boolean): Array<TKey>;
takeFromStart(n: number, filterFn?: (key: TKey) => boolean): Array<TKey>;
/** Reads after `from` (`null` is the nullish group), or from the start. */
private read;
supports(operation: IndexOperation): boolean;
get supportsRangeOptimization(): boolean;
canOptimizeRangeFor(value: unknown): boolean;
get keyCount(): number;
}