type ElementType = A extends ReadonlyArray ? T : never; type ElementsOfAll = []> = Inputs extends readonly [infer F, ...infer M] ? ElementsOfAll]> : R; type CartesianProduct = ElementsOfAll[]; /** * Returns the cartesian product of one or more iterables. * * Based on https://stackoverflow.com/a/72059390 * * @example * Consider the standard playing card ranks and its suits: * cartesianProduct([A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2], [♠, ♥, ♦, ♣]); * The product of these iterables would be [[A, ♠], [A, ♥]...] and so on until we have all 52 cards. */ export declare const cartesianProduct: >>(...sets: Sets) => CartesianProduct; export {};