UNPKG

529 BTypeScriptView Raw
1export declare function mergeProps<A, B>(a: A, b: B): B & A;
2export declare function mergeProps<A, B, C>(a: A, b: B, c: C): C & B & A;
3export declare function mergeProps<A, B, C, D>(a: A, b: B, c: C, d: D): D & C & B & A;
4/**
5 * Merge props and return the first non-undefined value.
6 * The later has higher priority. e.g. (10, 1, 5) => 5 wins.
7 * This is useful with legacy props that have been deprecated.
8 */
9export declare function mergeProp<T, DefaultT extends T = T>(defaultProp: DefaultT, ...propList: T[]): T | undefined;