str-merge
Version:
String utilities and conflict conditionals (includes tailwind-merge).
19 lines (18 loc) • 599 B
TypeScript
type ExcludeKeys = 'defaultVariants' | '';
type Undefined<T> = T extends undefined ? never : T;
export type cvxProps<T extends (...keys: any) => any> = Omit<Undefined<Parameters<T>[0]>, ExcludeKeys>;
export type cvxMap = {
[key: string]: {
[key: string]: string;
};
};
export type cvxVariant<T extends cvxMap> = {
[K in keyof T]?: keyof T[K];
};
export type cvxKeys<T extends cvxMap> = {
assign?: string;
variants: T;
defaultVariants?: cvxVariant<T>;
};
export declare function cvx<T extends cvxMap>(keys: cvxKeys<T>): (variant?: cvxVariant<T>) => string;
export {};