Skip to content

Commit 754c5d2

Browse files
committed
feat: add mentions type
1 parent 1572e8e commit 754c5d2

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

types/mentions/mentions.d.ts

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Project: https://github.com/vueComponent/ant-design-vue
2+
// Definitions: https://github.com/vueComponent/ant-design-vue/types
3+
4+
import { AntdComponent } from '../component';
5+
import { Option } from './option';
6+
7+
export declare class Mentions extends AntdComponent {
8+
static Option: typeof Option;
9+
/**
10+
* Auto get focus when component mounted
11+
* @default false
12+
* @type boolean
13+
*/
14+
autoFocus: boolean;
15+
16+
/**
17+
* Default value
18+
* @type string
19+
*/
20+
defaultValue: string;
21+
22+
/**
23+
* Customize filter option logic
24+
* @type false | (input: string, option: OptionProps) => boolean
25+
*/
26+
filterOption: false | ((input: string, option: Option) => boolean);
27+
28+
/**
29+
* Set mentions content when not match
30+
* @type any (string | slot)
31+
*/
32+
notFoundContent: any;
33+
34+
/**
35+
* Set popup placement
36+
* @default 'top'
37+
* @type string
38+
*/
39+
placement: 'top' | 'bottom';
40+
41+
/**
42+
* Set trigger prefix keyword
43+
* @default '@'
44+
* @type string | string[]
45+
*/
46+
prefix: string | string[];
47+
48+
/**
49+
* Set split string before and after selected mention
50+
* @default ' '
51+
* @type string
52+
*/
53+
split: string;
54+
55+
/**
56+
* Customize trigger search logic
57+
* @type (text: string, props: MentionsProps) => void
58+
*/
59+
validateSearch: (text: string, props: Mentions) => void;
60+
61+
/**
62+
* Set value of mentions
63+
* @type string
64+
*/
65+
value: string;
66+
67+
/**
68+
* Set the mount HTML node for suggestions
69+
* @default () => HTMLElement
70+
*/
71+
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
72+
}

types/mentions/option.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Project: https://github.com/vueComponent/ant-design-vue
2+
// Definitions: https://github.com/vueComponent/ant-design-vue/types
3+
4+
import { AntdComponent } from '../component';
5+
6+
export declare class Option extends AntdComponent {
7+
/**
8+
* value of suggestion, the value will insert into input filed while selected
9+
* @default ''
10+
* @type string
11+
*/
12+
value: string;
13+
}

0 commit comments

Comments
 (0)