UNPKG

2.4 kBTypeScriptView Raw
1import type { ValidateMessages } from 'rc-field-form/lib/interface';
2import * as React from 'react';
3import type { RequiredMark } from '../form/Form';
4import type { Locale } from '../locale-provider';
5import type { ConfigConsumerProps, CSPConfig, DirectionType, Theme, ThemeConfig } from './context';
6import { ConfigConsumer, ConfigContext, defaultIconPrefixCls } from './context';
7import type { RenderEmptyHandler } from './defaultRenderEmpty';
8import type { SizeType } from './SizeContext';
9import SizeContext from './SizeContext';
10export { type RenderEmptyHandler, ConfigContext, ConfigConsumer, type CSPConfig, type DirectionType, type ConfigConsumerProps, };
11export { defaultIconPrefixCls };
12export declare const configConsumerProps: string[];
13export interface ConfigProviderProps {
14 getTargetContainer?: () => HTMLElement | Window;
15 getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
16 prefixCls?: string;
17 iconPrefixCls?: string;
18 children?: React.ReactNode;
19 renderEmpty?: RenderEmptyHandler;
20 csp?: CSPConfig;
21 autoInsertSpaceInButton?: boolean;
22 form?: {
23 validateMessages?: ValidateMessages;
24 requiredMark?: RequiredMark;
25 colon?: boolean;
26 };
27 input?: {
28 autoComplete?: string;
29 };
30 pagination?: {
31 showSizeChanger?: boolean;
32 };
33 locale?: Locale;
34 pageHeader?: {
35 ghost: boolean;
36 };
37 componentSize?: SizeType;
38 componentDisabled?: boolean;
39 direction?: DirectionType;
40 space?: {
41 size?: SizeType | number;
42 };
43 virtual?: boolean;
44 dropdownMatchSelectWidth?: boolean;
45 theme?: ThemeConfig;
46}
47export declare const defaultPrefixCls = "ant";
48declare function getGlobalIconPrefixCls(): string;
49declare const setGlobalConfig: ({ prefixCls, iconPrefixCls, theme, }: Pick<ConfigProviderProps, "prefixCls" | "iconPrefixCls"> & {
50 theme?: Theme | undefined;
51}) => void;
52export declare const globalConfig: () => {
53 getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
54 getIconPrefixCls: typeof getGlobalIconPrefixCls;
55 getRootPrefixCls: () => string;
56};
57declare const ConfigProvider: React.FC<ConfigProviderProps> & {
58 /** @private internal Usage. do not use in your production */
59 ConfigContext: typeof ConfigContext;
60 SizeContext: typeof SizeContext;
61 config: typeof setGlobalConfig;
62};
63export default ConfigProvider;