chore: Definition message.config type (#38723)

* chore: message config ts

* chore: message config test case
This commit is contained in:
hms181231 2022-11-19 15:24:28 +08:00 committed by GitHub
parent 77ea4038d1
commit 39689bd81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ describe('message.config', () => {
expect(div.querySelector('.ant-message')).toBeTruthy(); expect(div.querySelector('.ant-message')).toBeTruthy();
message.config({ message.config({
getContainer: null, getContainer: undefined,
}); });
document.body.removeChild(div); document.body.removeChild(div);
@ -89,7 +89,7 @@ describe('message.config', () => {
expect(document.querySelectorAll('.ant-message-notice')).toHaveLength(0); expect(document.querySelectorAll('.ant-message-notice')).toHaveLength(0);
message.config({ message.config({
maxCount: null, maxCount: undefined,
}); });
}); });
@ -124,7 +124,7 @@ describe('message.config', () => {
expect(document.querySelector('.light-message-move-up')).toBeTruthy(); expect(document.querySelector('.light-message-move-up')).toBeTruthy();
message.config({ message.config({
prefixCls: null, prefixCls: undefined,
}); });
}); });

View File

@ -313,7 +313,7 @@ function destroy(key: React.Key) {
const baseStaticMethods: { const baseStaticMethods: {
open: (config: ArgsProps) => MessageType; open: (config: ArgsProps) => MessageType;
destroy: (key?: React.Key) => void; destroy: (key?: React.Key) => void;
config: any; config: typeof setMessageGlobalConfig;
useMessage: typeof useMessage; useMessage: typeof useMessage;
/** @private Internal Component. Do not use in your production. */ /** @private Internal Component. Do not use in your production. */
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel; _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;