mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-24 07:28:28 +08:00
27 lines
716 B
TypeScript
27 lines
716 B
TypeScript
import React from 'react';
|
|
|
|
import type { ConfigOptions as MessageConfig, MessageInstance } from '../message/interface';
|
|
import type { HookAPI as ModalHookAPI } from '../modal/useModal';
|
|
import type { NotificationConfig, NotificationInstance } from '../notification/interface';
|
|
|
|
export interface AppConfig {
|
|
message?: MessageConfig;
|
|
notification?: NotificationConfig;
|
|
}
|
|
|
|
export const AppConfigContext = React.createContext<AppConfig>({});
|
|
|
|
export interface useAppProps {
|
|
message: MessageInstance;
|
|
notification: NotificationInstance;
|
|
modal: ModalHookAPI;
|
|
}
|
|
|
|
const AppContext = React.createContext<useAppProps>({
|
|
message: {},
|
|
notification: {},
|
|
modal: {},
|
|
} as useAppProps);
|
|
|
|
export default AppContext;
|