index.d.ts 893 B

1234567891011121314
  1. import { ValidChar } from './interface';
  2. type TemplateSemanticClassNames<T extends string> = Partial<Record<T, string>>;
  3. export type SemanticSchema = {
  4. _default?: string;
  5. } & {
  6. [key: `${ValidChar}${string}`]: SemanticSchema;
  7. };
  8. export declare function mergeClassNames<T extends string, SemanticClassNames extends Partial<Record<T, any>> = TemplateSemanticClassNames<T>>(schema: SemanticSchema | undefined, ...classNames: (SemanticClassNames | undefined)[]): SemanticClassNames;
  9. /**
  10. * Merge classNames and styles from multiple sources.
  11. * When `schema` is provided, it will **must** provide the nest object structure.
  12. */
  13. export default function useMergeSemantic<ClassNamesType extends object, StylesType extends object>(classNamesList: (ClassNamesType | undefined)[], stylesList: (StylesType | undefined)[], schema?: SemanticSchema): readonly [ClassNamesType, StylesType];
  14. export {};