ygd
Version:
An enterprise-class UI design language and React-based implementation
45 lines (44 loc) • 1.87 kB
TypeScript
import * as React from 'react';
import { RenderEmptyHandler } from './renderEmpty';
export { RenderEmptyHandler };
export interface CSPConfig {
nonce?: string;
}
export interface ConfigConsumerProps {
getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
rootPrefixCls?: string;
getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string;
renderEmpty: RenderEmptyHandler;
csp?: CSPConfig;
autoInsertSpaceInButton?: boolean;
}
export declare const configConsumerProps: string[];
export interface ConfigProviderProps {
getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
prefixCls?: string;
children?: React.ReactNode;
renderEmpty?: RenderEmptyHandler;
csp?: CSPConfig;
autoInsertSpaceInButton?: boolean;
}
export declare const ConfigConsumer: React.ComponentClass<import("create-react-context").ConsumerProps<{
getPrefixCls: (suffixCls: string, customizePrefixCls?: string | undefined) => string;
renderEmpty: (componentName?: string | undefined) => React.ReactNode;
}>, any>;
declare class ConfigProvider extends React.Component<ConfigProviderProps> {
static defaultProps: {
autoInsertSpaceInButton: boolean;
};
getPrefixCls: (suffixCls: string, customizePrefixCls?: string | undefined) => string;
renderProvider: (context: ConfigConsumerProps) => JSX.Element;
render(): JSX.Element;
}
declare type IReactComponent<P = any> = React.StatelessComponent<P> | React.ComponentClass<P> | React.ClassicComponentClass<P>;
interface BasicExportProps {
prefixCls?: string;
}
interface ConsumerConfig {
prefixCls: string;
}
export declare function withConfigConsumer<ExportProps extends BasicExportProps>(config: ConsumerConfig): <ComponentDef>(Component: IReactComponent<any>) => React.SFC<ExportProps> & ComponentDef;
export default ConfigProvider;