UNPKG

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