@prezly/theme-kit-ui
Version:
UI components for Prezly themes
11 lines (10 loc) • 591 B
TypeScript
import type { ClassNames } from './styling';
type StylingFn<Props extends {}> = (props: Props, ...classNames: ClassNames[]) => string;
export type Theme<Element extends string, Props extends {} = {}> = {
[E in Element]: StylingFn<Props>;
};
type ThemeExtension<Element extends string, Props extends {}> = Partial<{
[E in Element]: ClassNames | ((props: Partial<Props>) => ClassNames);
}>;
export declare function extendTheme<Element extends string, Props extends {} | never>(theme: Theme<Element, Props>, extension: ThemeExtension<Element, Props>): Theme<Element, Props>;
export {};