UNPKG

antd-v5

Version:

An enterprise-class UI design language and React components implementation

124 lines (123 loc) 5.33 kB
import * as React from 'react'; import type { WarningContextProps } from '../_util/warning'; import type { FormProps } from '../form/Form'; import type { InputProps } from '../input'; import type { Locale } from '../locale'; import type { PaginationProps } from '../pagination'; import type { SelectProps } from '../select'; import type { SpaceProps } from '../space'; import type { AlertConfig, BadgeConfig, ButtonConfig, CardConfig, ComponentStyleConfig, ConfigConsumerProps, CSPConfig, DirectionType, DrawerConfig, FlexConfig, ImageConfig, ModalConfig, NotificationConfig, PopupOverflow, TableConfig, TabsConfig, TagConfig, 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?: ComponentStyleConfig & Pick<FormProps, 'requiredMark' | 'colon' | 'scrollToFirstError' | 'validateMessages'>; input?: ComponentStyleConfig & Pick<InputProps, 'autoComplete' | 'classNames' | 'styles'>; select?: ComponentStyleConfig & Pick<SelectProps, 'showSearch'>; pagination?: ComponentStyleConfig & Pick<PaginationProps, 'showSizeChanger'>; locale?: Locale; componentSize?: SizeType; componentDisabled?: boolean; direction?: DirectionType; space?: Pick<SpaceProps, 'size' | 'className' | 'classNames' | 'style' | 'styles'>; 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?: ComponentStyleConfig; 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?: ComponentStyleConfig; 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;