UNPKG

webglimpse

Version:

Webglimpse is a data visualization library for the web.

140 lines (139 loc) 6.14 kB
import { IdFunction } from './util'; import { Notification2, Notification3 } from './notification'; export declare class OrderedSet<V> { private _idOf; private _ids; private _indexes; private _valuesArray; private _valuesMap; private _valueAdded; private _valueMoved; private _valueRemoved; constructor(values?: V[], idFn?: IdFunction<V>, useNotifications?: boolean); get valueAdded(): Notification2<V, number>; get valueMoved(): Notification3<V, number, number>; get valueRemoved(): Notification2<V, number>; get length(): number; get isEmpty(): boolean; toArray(): V[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ every(callbackFn: (value: V, index: number, array: V[]) => boolean, thisArg?: any): boolean; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ some(callbackFn: (value: V, index: number, array: V[]) => boolean, thisArg?: any): boolean; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ forEach(callbackFn: (value: V, index: number, array: V[]) => void, thisArg?: any): void; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ map<U>(callbackFn: (value: V, index: number, array: V[]) => U, thisArg?: any): U[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ filter(callbackFn: (value: V, index: number, array: V[]) => boolean, thisArg?: any): V[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ reduce<U>(callbackFn: (previousValue: U, currentValue: V, currentIndex: number, array: V[]) => U, initialValue: U): U; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedSet is undefined. */ reduceRight<U>(callbackFn: (previousValue: U, currentValue: V, currentIndex: number, array: V[]) => U, initialValue: U): U; idAt(index: number): string; valueAt(index: number): V; indexFor(id: string): number; valueFor(id: string): V; idOf(value: V): string; indexOf(value: V): number; hasValue(value: V): boolean; hasValues(values: V[]): boolean; hasId(id: string): boolean; hasIds(ids: string[]): boolean; add(value: V, index?: number, moveIfExists?: boolean): void; addAll(values: V[], index?: number, moveIfExists?: boolean): void; private _add; removeValue(value: V): void; removeId(id: string): void; removeIndex(index: number): void; removeAll(): void; retainValues(values: V[]): void; retainIds(ids: string[]): void; retainIndices(indices: number[]): void; private _retain; private _remove; } export declare class OrderedStringSet { private _indexes; private _valuesArray; private _valueAdded; private _valueMoved; private _valueRemoved; constructor(values?: string[], useNotifications?: boolean); get valueAdded(): Notification2<string, number>; get valueMoved(): Notification3<string, number, number>; get valueRemoved(): Notification2<string, number>; get length(): number; get isEmpty(): boolean; toArray(): string[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ every(callbackFn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ some(callbackFn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ forEach(callbackFn: (value: string, index: number, array: string[]) => void, thisArg?: any): void; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ map<U>(callbackFn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ filter(callbackFn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ reduce<U>(callbackFn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; /** * The callback should not modify its array arg; if it does, the subsequent behavior * of this OrderedStringSet is undefined. */ reduceRight<U>(callbackFn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; valueAt(index: number): string; indexOf(value: string): number; hasValue(value: string): boolean; hasValues(values: string[]): boolean; add(value: string, index?: number, moveIfExists?: boolean): void; addAll(values: string[], index?: number, moveIfExists?: boolean): void; private _add; removeValue(value: string): void; removeIndex(index: number): void; removeAll(): void; retainValues(values: string[]): void; retainIndices(indices: number[]): void; private _retain; private _remove; }