import { Theme } from '../components/theme'; import { Breakpoints, ColorPropsValue, ResponsiveProp, ResponsiveValue } from '../types'; import { StatusType } from '../components/status'; import { SerializedStyles } from '@emotion/react'; /** * 为类名添加统一前缀,通常为内部使用 * @param prefixName */ export declare function definePrefix(prefixName: string): (...names: string[]) => string; /** * 统一管理类名 * @param prefixName */ export declare function defineClasses(prefixName: string): { root: string; }; export declare function defineClasses(prefixName: string, names: T[]): { [P in T]: string; } & { root: string; }; /** * @private 携带`CanUI`前缀,内部使用 */ export declare function defineInnerClasses(prefixName: string): { root: string; }; export declare function defineInnerClasses(prefixName: string, names: T[]): { [P in T]: string; } & { root: string; }; /** * 用于定义css,返回一个可调用的函数,可直接传入emotion的css属性 * @param callback */ export declare function defineCss(callback: (theme: Theme) => T): () => T; /** * 使用css的hook,直接在组件或其他hook中调用,相当于{@link defineCss}的立即执行版本 * @param callback * @param deps */ export declare function useCss(callback: (theme: Theme) => T, deps?: any[]): T; /** * 将大多数组件的color属性转换为可用的颜色值 * @param colorPropsValue * @param theme */ export declare function colorTransfer(colorPropsValue: ColorPropsValue, theme: Theme): string; /** * 将useCss()与colorTransfer()方法结合封装 * @param colorPropsValue */ export declare function useColor(colorPropsValue: ColorPropsValue | undefined): string | undefined; /** * 点击的波纹效果 * @param colorPropsValue */ export declare function useTouchSpread(colorPropsValue: ColorPropsValue): (element: Animatable) => void; /** * 生成响应式样式,与{@link responsiveStyles}的区别在于,本方法会遍历所有`breakpoints`,触发回调函数 * @param breakpoints 传入{@link Theme}中的断点,或自定义断点 * @param callback 每个断点触发一次回调 */ export declare function responsiveVariables(breakpoints: ResponsiveValue, callback: (key: Breakpoints, px: number) => string | SerializedStyles): string; /** * 生成响应式样式,与{@link responsiveVariables}的区别在于,本方法只会生成给定的断点所对应的样式 * @param styles 样式定义,对象类型,键名可为断点也可为具体的宽度 * @param breakpoints 定义断点,默认使用{@link defaultBreakpoints} * @example * responsiveStyles({ * sm: 'color: red;', * '500px': 'color: pink;' * }) */ export declare function responsiveStyles(styles: { [P in Breakpoints]?: string | SerializedStyles; }, breakpoints?: ResponsiveValue): string; /** * 将响应式的值统一转换为对象格式 */ export declare function toResponsiveValue(prop?: undefined): undefined; export declare function toResponsiveValue(prop: ResponsiveProp): ResponsiveValue; /** * 使用hooks监听响应式值的变化,通常用于css不能满足需求的情况 * @param prop * @param disabled */ export declare function useResponsiveValue(prop: ResponsiveProp, disabled?: boolean): import("react").RefObject>; /** * 使用状态对应的颜色 * @param status */ export declare function useStatusColor(status?: StatusType): string;