Skip to content

Commit 5d14259

Browse files
author
binhaoCen
authored
chore: update type mentions (#2716)
1 parent ec024c8 commit 5d14259

File tree

3 files changed

+62
-57
lines changed

3 files changed

+62
-57
lines changed

types/mentions/mentions.d.ts

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,73 @@
33

44
import { AntdComponent } from '../component';
55
import { Option } from './option';
6+
import { VNodeChild } from 'vue';
67

78
export declare class Mentions extends AntdComponent {
89
static Option: typeof Option;
9-
/**
10-
* Auto get focus when component mounted
11-
* @default false
12-
* @type boolean
13-
*/
14-
autofocus: boolean;
10+
$props: {
11+
/**
12+
* Auto get focus when component mounted
13+
* @default false
14+
* @type boolean
15+
*/
16+
autofocus?: boolean;
1517

16-
/**
17-
* Default value
18-
* @type string
19-
*/
20-
defaultValue: string;
18+
/**
19+
* Default value
20+
* @type string
21+
*/
22+
defaultValue?: string;
2123

22-
/**
23-
* Customize filter option logic
24-
* @type false | (input: string, option: OptionProps) => boolean
25-
*/
26-
filterOption: false | ((input: string, option: Option) => boolean);
24+
/**
25+
* Customize filter option logic
26+
* @type false | (input: string, option: OptionProps) => boolean
27+
*/
28+
filterOption?: false | ((input: string, option: Option) => boolean);
2729

28-
/**
29-
* Set mentions content when not match
30-
* @type any (string | slot)
31-
*/
32-
notFoundContent: any;
30+
/**
31+
* Set mentions content when not match
32+
* @type any (string | slot)
33+
*/
34+
notFoundContent?: VNodeChild | JSX.Element;
3335

34-
/**
35-
* Set popup placement
36-
* @default 'top'
37-
* @type string
38-
*/
39-
placement: 'top' | 'bottom';
36+
/**
37+
* Set popup placement
38+
* @default 'top'
39+
* @type string
40+
*/
41+
placement?: 'top' | 'bottom';
4042

41-
/**
42-
* Set trigger prefix keyword
43-
* @default '@'
44-
* @type string | string[]
45-
*/
46-
prefix: string | string[];
43+
/**
44+
* Set trigger prefix keyword
45+
* @default '@'
46+
* @type string | string[]
47+
*/
48+
prefix?: string | string[];
4749

48-
/**
49-
* Set split string before and after selected mention
50-
* @default ' '
51-
* @type string
52-
*/
53-
split: string;
50+
/**
51+
* Set split string before and after selected mention
52+
* @default ' '
53+
* @type string
54+
*/
55+
split?: string;
5456

55-
/**
56-
* Customize trigger search logic
57-
* @type (text: string, props: MentionsProps) => void
58-
*/
59-
validateSearch: (text: string, props: Mentions) => void;
57+
/**
58+
* Customize trigger search logic
59+
* @type (text: string, props: MentionsProps) => void
60+
*/
61+
validateSearch?: (text: string, props: Mentions) => void;
6062

61-
/**
62-
* Set value of mentions
63-
* @type string
64-
*/
65-
value: string;
63+
/**
64+
* Set value of mentions
65+
* @type string
66+
*/
67+
value?: string;
6668

67-
/**
68-
* Set the mount HTML node for suggestions
69-
* @default () => HTMLElement
70-
*/
71-
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
69+
/**
70+
* Set the mount HTML node for suggestions
71+
* @default () => HTMLElement
72+
*/
73+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
74+
}
7275
}

types/mentions/option.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
import { AntdComponent } from '../component';
55

66
export declare class Option extends AntdComponent {
7-
/**
7+
$props: {
8+
/**
89
* value of suggestion, the value will insert into input filed while selected
910
* @default ''
1011
* @type string
1112
*/
12-
value: string;
13+
value?: string;
14+
}
1315
}

types/notification.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface NotificationOptions extends NotificationConfigOptions {
2222
* The content of notification box (required)
2323
* @type string | VNode | Function
2424
*/
25-
description: VNodeChild | JSX.Element | Function;
25+
description?: VNodeChild | JSX.Element | Function;
2626

2727
/**
2828
* Customized icon

0 commit comments

Comments
 (0)