UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

135 lines (134 loc) 5.43 kB
import * as React from 'react'; import type { WarningContextProps } from '../_util/warning'; import type { Locale } from '../locale'; import type { AlertConfig, BadgeConfig, ButtonConfig, CardConfig, CollapseConfig, ComponentStyleConfig, ConfigConsumerProps, CSPConfig, DirectionType, DrawerConfig, FlexConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, MenuConfig, ModalConfig, NotificationConfig, PaginationConfig, PopupOverflow, SelectConfig, SpaceConfig, TableConfig, TabsConfig, TagConfig, TextAreaConfig, Theme, ThemeConfig, TourConfig, TransferConfig, WaveConfig } from './context'; import { ConfigConsumer, ConfigContext, defaultIconPrefixCls } from './context'; import type { RenderEmptyHandler } from './defaultRenderEmpty'; import useConfig from './hooks/useConfig'; import type { SizeType } from './SizeContext'; import SizeContext from './SizeContext'; export declare const warnContext: (componentName: string) => void; export { ConfigConsumer, ConfigContext, defaultIconPrefixCls, type ConfigConsumerProps, type CSPConfig, type DirectionType, type RenderEmptyHandler, type ThemeConfig, }; export declare const configConsumerProps: string[]; export interface ConfigProviderProps { getTargetContainer?: () => HTMLElement | Window; getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; prefixCls?: string; iconPrefixCls?: string; children?: React.ReactNode; renderEmpty?: RenderEmptyHandler; csp?: CSPConfig; autoInsertSpaceInButton?: boolean; form?: FormConfig; input?: InputConfig; textArea?: TextAreaConfig; select?: SelectConfig; pagination?: PaginationConfig; /** * @descCN 语言包配置,语言包可到 `antd/locale` 目录下寻找。 * @descEN Language package setting, you can find the packages in `antd/locale`. */ locale?: Locale; componentSize?: SizeType; componentDisabled?: boolean; /** * @descCN 设置布局展示方向。 * @descEN Set direction of layout. * @default ltr */ direction?: DirectionType; space?: SpaceConfig; /** * @descCN 设置 `false` 时关闭虚拟滚动。 * @descEN Close the virtual scrolling when setting `false`. * @default true */ virtual?: boolean; /** @deprecated Please use `popupMatchSelectWidth` instead */ dropdownMatchSelectWidth?: boolean; popupMatchSelectWidth?: boolean; popupOverflow?: PopupOverflow; theme?: ThemeConfig; warning?: WarningContextProps; alert?: AlertConfig; anchor?: ComponentStyleConfig; button?: ButtonConfig; calendar?: ComponentStyleConfig; carousel?: ComponentStyleConfig; cascader?: ComponentStyleConfig; collapse?: CollapseConfig; divider?: ComponentStyleConfig; drawer?: DrawerConfig; typography?: ComponentStyleConfig; skeleton?: ComponentStyleConfig; spin?: ComponentStyleConfig; segmented?: ComponentStyleConfig; statistic?: ComponentStyleConfig; steps?: ComponentStyleConfig; image?: ImageConfig; layout?: ComponentStyleConfig; list?: ComponentStyleConfig; mentions?: ComponentStyleConfig; modal?: ModalConfig; progress?: ComponentStyleConfig; result?: ComponentStyleConfig; slider?: ComponentStyleConfig; breadcrumb?: ComponentStyleConfig; menu?: MenuConfig; floatButtonGroup?: FloatButtonGroupConfig; checkbox?: ComponentStyleConfig; descriptions?: ComponentStyleConfig; empty?: ComponentStyleConfig; badge?: BadgeConfig; radio?: ComponentStyleConfig; rate?: ComponentStyleConfig; switch?: ComponentStyleConfig; transfer?: TransferConfig; avatar?: ComponentStyleConfig; message?: ComponentStyleConfig; tag?: TagConfig; table?: TableConfig; card?: CardConfig; tabs?: TabsConfig; timeline?: ComponentStyleConfig; timePicker?: ComponentStyleConfig; upload?: ComponentStyleConfig; notification?: NotificationConfig; tree?: ComponentStyleConfig; colorPicker?: ComponentStyleConfig; datePicker?: ComponentStyleConfig; rangePicker?: ComponentStyleConfig; dropdown?: ComponentStyleConfig; flex?: FlexConfig; /** * Wave is special component which only patch on the effect of component interaction. */ wave?: WaveConfig; tour?: TourConfig; } type holderRenderType = (children: React.ReactNode) => React.ReactNode; export declare const defaultPrefixCls = "ant"; declare function getGlobalIconPrefixCls(): string; interface GlobalConfigProps { prefixCls?: string; iconPrefixCls?: string; theme?: Theme | ThemeConfig; holderRender?: holderRenderType; } declare const setGlobalConfig: (props: GlobalConfigProps) => void; export declare const globalConfig: () => { getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string; getIconPrefixCls: typeof getGlobalIconPrefixCls; getRootPrefixCls: () => string; getTheme: () => ThemeConfig; holderRender: holderRenderType | undefined; }; declare const ConfigProvider: React.FC<ConfigProviderProps> & { /** @private internal Usage. do not use in your production */ ConfigContext: typeof ConfigContext; /** @deprecated Please use `ConfigProvider.useConfig().componentSize` instead */ SizeContext: typeof SizeContext; config: typeof setGlobalConfig; useConfig: typeof useConfig; }; export default ConfigProvider;