UNPKG

1.6 kBTypeScriptView Raw
1import * as React from 'react';
2import type { DataDrivenOptionProps as MentionsOptionProps, MentionsProps as RcMentionsProps, MentionsRef as RcMentionsRef } from 'rc-mentions/lib/Mentions';
3import type { InputStatus } from '../_util/statusUtils';
4import type { Variant } from '../form/hooks/useVariants';
5export declare const Option: React.FC<import("rc-mentions/lib/Option").OptionProps>;
6export type MentionPlacement = 'top' | 'bottom';
7export type { DataDrivenOptionProps as MentionsOptionProps } from 'rc-mentions/lib/Mentions';
8export interface OptionProps {
9 value: string;
10 children: React.ReactNode;
11 [key: string]: any;
12}
13export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
14 rootClassName?: string;
15 loading?: boolean;
16 status?: InputStatus;
17 options?: MentionsOptionProps[];
18 popupClassName?: string;
19 /**
20 * @since 5.13.0
21 * @default "outlined"
22 */
23 variant?: Variant;
24}
25export interface MentionsRef extends RcMentionsRef {
26}
27interface MentionsConfig {
28 prefix?: string | string[];
29 split?: string;
30}
31interface MentionsEntity {
32 prefix: string;
33 value: string;
34}
35type CompoundedComponent = React.ForwardRefExoticComponent<MentionProps & React.RefAttributes<MentionsRef>> & {
36 Option: typeof Option;
37 _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
38 getMentions: (value: string, config?: MentionsConfig) => MentionsEntity[];
39};
40declare const Mentions: CompoundedComponent;
41declare const PurePanel: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element;
42export default Mentions;