import type { CSSInterpolation } from '@ant-design/cssinjs'; import type React from 'react'; import { type CSSVariables } from './hooks'; export interface BaseToken { colorText?: string; lineHeight?: number; [key: string]: any; } export interface ComponentToken extends BaseToken { themeId?: number; antCls?: string; componentCls?: string; placeholderContent?: string; } export type GenerateStyle = (token: T) => Record; export interface UseStyleResult { wrapSSR: (node: React.ReactElement) => React.ReactElement; hashId: string; styles: Record; token: T; } export type { CSSVariables }; /** * 生成一个useStyle注册函数 * @example * import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from 'antd'; * const { getPrefixCls } = useContext(AntdConfigProvider.ConfigContext); * const { token, theme, hashId } = antdTheme?.useToken(); * const useStyle = createStyleRegister({ * theme: theme, * token: { * ...token, * antCls: getPrefixCls(), * }, * hashId, * cssVariables: { * '--md-editor-color-primary': token.colorPrimary, * }, * }); * @param options 配置选项 * @param options.theme antd主题对象 * @param options.token 主题token配置 * @param options.hashId 样式hash ID * @param options.cssVariables CSS变量对象 * @returns 返回一个样式注册函数 */ export declare function createStyleRegister(options?: { theme?: any; token?: Partial; hashId?: string; cssVariables?: CSSVariables; }): (componentName: string, styleFn: (token: T) => CSSInterpolation) => { wrapSSR: (node: React.ReactElement>) => React.JSX.Element; hashId: string; };