mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 22:39:34 +08:00
chore: prefer using @internal annotation over other markups (#37816)
This commit is contained in:
parent
f5a5077d80
commit
49206a53c5
@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
interface BreadcrumbSeparatorInterface extends React.FC<{ children?: React.ReactNode }> {
|
||||
/** @internal */
|
||||
__ANT_BREADCRUMB_SEPARATOR: boolean;
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,7 @@ export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;
|
||||
interface CompoundedComponent
|
||||
extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>> {
|
||||
Group: typeof Group;
|
||||
/** @internal */
|
||||
__ANT_BUTTON: boolean;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ export { CheckboxGroupProps, CheckboxOptionType } from './Group';
|
||||
interface CompoundedComponent
|
||||
extends React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>> {
|
||||
Group: typeof Group;
|
||||
/** @internal */
|
||||
__ANT_CHECKBOX: boolean;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ export interface DropdownButtonProps extends ButtonGroupProps, DropdownProps {
|
||||
}
|
||||
|
||||
interface DropdownButtonInterface extends React.FC<DropdownButtonProps> {
|
||||
/** @internal */
|
||||
__ANT_BUTTON: boolean;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ interface FormItemInputMiscProps {
|
||||
warnings: React.ReactNode[];
|
||||
marginBottom?: number | null;
|
||||
onErrorVisibleChanged?: (visible: boolean) => void;
|
||||
/** @private Internal Usage, do not use in any of your production. */
|
||||
/** @internal do not use in any of your production. */
|
||||
_internalItemRender?: {
|
||||
mark: string;
|
||||
render: (
|
||||
|
@ -7,7 +7,7 @@ import { getFieldId, toArray } from '../util';
|
||||
|
||||
export interface FormInstance<Values = any> extends RcFormInstance<Values> {
|
||||
scrollToField: (name: NamePath, options?: ScrollOptions) => void;
|
||||
/** This is an internal usage. Do not use in your prod */
|
||||
/** @internal: This is an internal usage. Do not use in your prod */
|
||||
__INTERNAL__: {
|
||||
/** No! Do not use this in your code! */
|
||||
name?: string;
|
||||
|
@ -9,7 +9,7 @@ export interface MenuContextProps {
|
||||
antdMenuTheme?: MenuTheme;
|
||||
direction?: DirectionType;
|
||||
firstLevel: boolean;
|
||||
/** @private Internal Usage. Safe to remove */
|
||||
/** @internal Safe to remove */
|
||||
disableMenuItemTitleTooltip?: boolean;
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@ export interface OverrideContextProps {
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
/** @private Internal Usage. Only used for Dropdown component. Do not use this in your production. */
|
||||
/** @internal Only used for Dropdown component. Do not use this in your production. */
|
||||
const OverrideContext = React.createContext<OverrideContextProps | null>(null);
|
||||
|
||||
/** @private Internal Usage. Only used for Dropdown component. Do not use this in your production. */
|
||||
/** @internal Only used for Dropdown component. Do not use this in your production. */
|
||||
export const OverrideProvider = ({
|
||||
children,
|
||||
...restProps
|
||||
|
@ -30,9 +30,8 @@ export interface MenuProps extends Omit<RcMenuProps, 'items'> {
|
||||
theme?: MenuTheme;
|
||||
inlineIndent?: number;
|
||||
|
||||
// >>>>> Private
|
||||
/**
|
||||
* @private Internal Usage. Not promise crash if used in production. Connect with chenshuai2144
|
||||
* @internal Not promise crash if used in production. Connect with chenshuai2144
|
||||
* for removing.
|
||||
*/
|
||||
_internalDisableMenuItemTitleTooltip?: boolean;
|
||||
|
@ -271,7 +271,7 @@ export interface MessageApi extends MessageInstance {
|
||||
useMessage(): [MessageInstance, React.ReactElement];
|
||||
}
|
||||
|
||||
/** @private test Only function. Not work on production */
|
||||
/** @internal test Only function. Not work on production */
|
||||
export const getInstance = () => (process.env.NODE_ENV === 'test' ? messageInstance : null);
|
||||
|
||||
export default api as MessageApi;
|
||||
|
@ -338,7 +338,7 @@ export interface NotificationApi extends NotificationInstance {
|
||||
useNotification: () => [NotificationInstance, React.ReactElement];
|
||||
}
|
||||
|
||||
/** @private test Only function. Not work on production */
|
||||
/** @internal test Only function. Not work on production */
|
||||
export const getInstance = async (cacheKey: string) =>
|
||||
process.env.NODE_ENV === 'test' ? notificationInstance[cacheKey] : null;
|
||||
|
||||
|
@ -9,7 +9,7 @@ import { getTransitionName } from '../_util/motion';
|
||||
export interface PopoverProps extends AbstractTooltipProps {
|
||||
title?: React.ReactNode | RenderFunction;
|
||||
content?: React.ReactNode | RenderFunction;
|
||||
/** @private Used For Popconfirm. Safe to remove. */
|
||||
/** @internal Used For Popconfirm. Safe to remove. */
|
||||
_overlay?: React.ReactNode;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ interface CompoundedComponent
|
||||
extends React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLElement>> {
|
||||
Group: typeof Group;
|
||||
Button: typeof Button;
|
||||
/** @internal */
|
||||
__ANT_RADIO: boolean;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ export interface SwitchProps {
|
||||
|
||||
interface CompoundedComponent
|
||||
extends React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLElement>> {
|
||||
/** @internal */
|
||||
__ANT_SWITCH: boolean;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ function getNode(dom: React.ReactNode, defaultNode: React.ReactNode, needDom?: b
|
||||
return dom || (needDom && defaultNode);
|
||||
}
|
||||
|
||||
function toList<T>(val: T | T[]): T[] {
|
||||
function toList<T extends any>(val: T | T[]): T[] {
|
||||
if (val === false) {
|
||||
return [false, false] as T[];
|
||||
}
|
||||
|
@ -18,7 +18,8 @@
|
||||
"noImplicitAny": true,
|
||||
"target": "es6",
|
||||
"lib": ["dom", "es2017"],
|
||||
"skipLibCheck": true
|
||||
"skipLibCheck": true,
|
||||
"stripInternal": true
|
||||
},
|
||||
"exclude": ["node_modules", "lib", "es"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user