UNPKG

837 BTypeScriptView Raw
1declare type Props<T> = T extends Record<string, infer V> ? Record<keyof T, V> : T;
2declare type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
3/**
4 * Given possible values for each prop, returns all combinations of those prop values.
5 * To generate the prop names and values from the component source see the `parsePropValues` utility
6 *
7 * @param {Object} propValues an object with the shape {propName: arrayOfPossibleValues}
8 * @returns {Array} an array of all prop combinations [{propAName: propAValue, propBName: propBValue}]
9 *
10 * @module generatePropCombinations
11 * @private
12 */
13export declare function generatePropCombinations<T>(propValues: Props<T>): Record<keyof Props<T>, ArrayElement<Props<T>[keyof Props<T>]>>[];
14export default generatePropCombinations;
15//# sourceMappingURL=generatePropCombinations.d.ts.map
\No newline at end of file