- wrapUnsorted<T>(unsortedData, comparer?): {
at: ((offset: number) => undefined | T);
indexOf: ((sought: T, start?: number, end?: number) => number);
insert: ((toInsert: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; });
insertionIndex: ((toInsert: T) => number);
remove: ((toRemove: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; });
toArray: (() => T[]);
get data(): T[];
get length(): number;
} Parameters
- unsortedData: T[]
- comparer: Comparer<T> = defaultComparer
Returns {
at: ((offset: number) => undefined | T);
indexOf: ((sought: T, start?: number, end?: number) => number);
insert: ((toInsert: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; });
insertionIndex: ((toInsert: T) => number);
remove: ((toRemove: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; });
toArray: (() => T[]);
get data(): T[];
get length(): number;
}
at: ((offset: number) => undefined | T)
- (offset): undefined | T
Returns undefined | T
indexOf: ((sought: T, start?: number, end?: number) => number)
- (sought, start?, end?): number
Parameters
- sought: T
- start: number = 0
- end: number = store.length
Returns number
insert: ((toInsert: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; })
- (toInsert): { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; }
Returns { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; }
insertionIndex: ((toInsert: T) => number)
- (toInsert): number
Returns number
remove: ((toRemove: T) => { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; })
- (toRemove): { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; }
Returns { indexOf: (sought: T, start?: number, end?: number) => number; insertionIndex: (toInsert: T) => number; insert: (toInsert: T) => ...; remove: (toRemove: T) => ...; at: (offset: number) => T | undefined; readonly length: number; readonly data: T[]; toArray: () => T[]; }
toArray: (() => T[])
get data(): T[]
get length(): number
Returns an immutable wrapper around an array, initially unsorted. Sorts data and passes to wrapSorted.