UNPKG

1.23 kBTypeScriptView Raw
1import type { MentionsProps as RcMentionsProps, MentionsRef as RcMentionsRef } from 'rc-mentions/lib/Mentions';
2import * as React from 'react';
3import type { InputStatus } from '../_util/statusUtils';
4export declare const Option: React.FC<import("rc-mentions/lib/Option").OptionProps>;
5export type MentionPlacement = 'top' | 'bottom';
6export interface OptionProps {
7 value: string;
8 children: React.ReactNode;
9 [key: string]: any;
10}
11export interface MentionProps extends RcMentionsProps {
12 loading?: boolean;
13 status?: InputStatus;
14 popupClassName?: string;
15}
16export interface MentionsRef extends RcMentionsRef {
17}
18export interface MentionState {
19 focused: boolean;
20}
21interface MentionsConfig {
22 prefix?: string | string[];
23 split?: string;
24}
25interface MentionsEntity {
26 prefix: string;
27 value: string;
28}
29interface CompoundedComponent extends React.ForwardRefExoticComponent<MentionProps & React.RefAttributes<MentionsRef>> {
30 Option: typeof Option;
31 _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
32 getMentions: (value: string, config?: MentionsConfig) => MentionsEntity[];
33}
34declare const Mentions: CompoundedComponent;
35declare const PurePanel: any;
36export default Mentions;