mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
26 lines
713 B
TypeScript
26 lines
713 B
TypeScript
import React from 'react';
|
|
import type { MessageInstance, ConfigOptions as MessageConfig } from '../message/interface';
|
|
import type { NotificationInstance, NotificationConfig } from '../notification/interface';
|
|
import type { HookAPI as ModalHookAPI } from '../modal/useModal';
|
|
|
|
export type 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;
|