custom-permutation
Version:
Permutation generator with custom options.
33 lines (32 loc) • 1.11 kB
TypeScript
export declare class CustomPermutationGenerator {
private elementList;
private choicesByIndex;
private nonChoicesByIndex;
private elementsOrderAbsolute?;
private passFunction?;
set: any[];
permutationGenOfSet: any;
nextIndexList: number[];
finalChoicesByIndexInSet: {};
history: any[];
historyHashes: any[];
current: any[];
cursor: number;
constructor(elementList: any[], choicesByIndex?: object, nonChoicesByIndex?: object, elementsOrderAbsolute?: any[], passFunction?: (items: any[]) => boolean);
removeNonChoicesIndexes(): void;
setChoicesIndexesInSet(): void;
getAllIndexesOfElementInList(el: any, list: any): any[];
completeRestOfIndexes(): void;
extendIndexesOfSameElements(choicesByIndex: any, indexesOfSameElements: any): void;
prev(): any;
next(): any;
nextDistinct(): any;
saveCurrentToHistory(): void;
getHash(elList: any[]): string;
getElementListByInitialListIndexes(indexes: any): any[];
reset(): void;
getSet(): any[];
isEmpty(): boolean;
getCurrent(): any;
last(): any;
}