Skip to content

Commit 61ec4ad

Browse files
authored
chore: update type alert (#2688)
1 parent 9f90d4c commit 61ec4ad

File tree

1 file changed

+51
-48
lines changed

1 file changed

+51
-48
lines changed

types/alert.d.ts

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,65 @@
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

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

78
export declare class Alert extends AntdComponent {
8-
/**
9-
* Called when close animation is finished
10-
* @type Function
11-
*/
12-
afterClose: () => void;
9+
$props: {
10+
/**
11+
* Called when close animation is finished
12+
* @type Function
13+
*/
14+
afterClose?: () => void;
1315

14-
/**
15-
* Whether to show as banner
16-
* @default false
17-
* @type boolean
18-
*/
19-
banner: boolean;
16+
/**
17+
* Whether to show as banner
18+
* @default false
19+
* @type boolean
20+
*/
21+
banner?: boolean;
2022

21-
/**
22-
* Whether Alert can be closed
23-
* @type boolean
24-
*/
25-
closable: boolean;
23+
/**
24+
* Whether Alert can be closed
25+
* @type boolean
26+
*/
27+
closable?: boolean;
2628

27-
/**
28-
* Close text to show
29-
* @type any (string | slot)
30-
*/
31-
closeText: any;
29+
/**
30+
* Close text to show
31+
* @type any (string | slot)
32+
*/
33+
closeText?: VNodeChild | JSX.Element;
3234

33-
/**
34-
* additional content of Alert
35-
* @type any (string | slot)
36-
*/
37-
description: any;
35+
/**
36+
* additional content of Alert
37+
* @type any (string | slot)
38+
*/
39+
description?: VNodeChild | JSX.Element;
3840

39-
/**
40-
* Custom icon, effective when showIcon is true
41-
* @type any (VNode | slot)
42-
*/
43-
icon: any;
41+
/**
42+
* Custom icon, effective when showIcon is true
43+
* @type any (VNode | slot)
44+
*/
45+
icon?: VNodeChild | JSX.Element;
4446

45-
/**
46-
* Content of Alert
47-
* @type any (string | slot)
48-
*/
49-
message: any;
47+
/**
48+
* Content of Alert
49+
* @type any (string | slot)
50+
*/
51+
message?: VNodeChild | JSX.Element;
5052

51-
/**
52-
* Whether to show icon
53-
* @default false, in banner mode default is true
54-
* @type boolean
55-
*/
56-
showIcon: boolean;
53+
/**
54+
* Whether to show icon
55+
* @default false, in banner mode default is true
56+
* @type boolean
57+
*/
58+
showIcon?: boolean;
5759

58-
/**
59-
* Type of Alert styles, options: success, info, warning, error
60-
* @default info, in banner mode default is warning
61-
* @type string
62-
*/
63-
type: 'success' | 'info' | 'warning' | 'error';
60+
/**
61+
* Type of Alert styles, options: success, info, warning, error
62+
* @default info, in banner mode default is warning
63+
* @type string
64+
*/
65+
type?: 'success' | 'info' | 'warning' | 'error';
66+
};
6467
}

0 commit comments

Comments
 (0)