mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
Add types for warning
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import warning from 'warning';
|
||||
import * as warning from 'warning';
|
||||
|
||||
const warned: { [msg: string]: boolean } = {};
|
||||
const warned: Record<string, boolean> = {};
|
||||
export default (valid: boolean, message: string): void => {
|
||||
if (!valid && !warned[message]) {
|
||||
warning(false, message);
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import RcDrawer from 'rc-drawer';
|
||||
import createReactContext, { Context } from 'create-react-context';
|
||||
import warning from 'warning';
|
||||
import * as warning from 'warning';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '../icon';
|
||||
import { withConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
@@ -4,7 +4,7 @@ import RcSelect, { Option, OptGroup } from 'rc-select';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider';
|
||||
import omit from 'omit.js';
|
||||
import warning from 'warning';
|
||||
import * as warning from 'warning';
|
||||
import Icon from '../icon';
|
||||
import { tuple } from '../_util/type';
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
"@types/react-dom": "^16.0.11",
|
||||
"@types/react-intl": "^2.3.14",
|
||||
"@types/react-slick": "^0.23.2",
|
||||
"@types/warning": "^3.0.0",
|
||||
"@yesmeck/offline-plugin": "^5.0.5",
|
||||
"ansi-styles": "^3.2.1",
|
||||
"antd-theme-generator": "^1.1.4",
|
||||
|
||||
2
typings/custom-typings.d.ts
vendored
2
typings/custom-typings.d.ts
vendored
@@ -14,8 +14,6 @@ declare module 'rc-util*';
|
||||
|
||||
declare module 'shallowequal';
|
||||
|
||||
declare module 'warning';
|
||||
|
||||
declare module 'css-animation*';
|
||||
|
||||
declare module 'rc-select';
|
||||
|
||||
Reference in New Issue
Block a user