Skip to content

Commit 17456b6

Browse files
authored
chore: update comment and timeline type (#2701)
1 parent 1d8341b commit 17456b6

File tree

3 files changed

+74
-47
lines changed

3 files changed

+74
-47
lines changed

types/comment.d.ts

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
// Project: https://github.com/vueComponent/ant-design-vue
22
// Definitions: https://github.com/vueComponent/ant-design-vue/types
33

4+
import { VNodeChild } from 'vue';
45
import { AntdComponent } from './component';
56

67
export declare class Comment extends AntdComponent {
7-
/** List of action items rendered below the comment content */
8-
actions?: Array<any>;
9-
/** The element to display as the comment author. */
10-
author?: any;
11-
/** The element to display as the comment avatar - generally an antd Avatar */
12-
avatar?: any;
13-
/** The main content of the comment */
14-
content: any;
15-
/** Comment prefix defaults to '.ant-comment' */
16-
prefixCls?: string;
17-
/** A datetime element containing the time to be displayed */
18-
datetime?: any;
8+
$props: {
9+
/** List of action items rendered below the comment content
10+
* any ( array | slot )
11+
*/
12+
actions?: VNodeChild | JSX.Element;
13+
14+
/** The element to display as the comment author
15+
* @type any ( string | slot)
16+
*/
17+
author?: VNodeChild | JSX.Element;
18+
19+
/** The element to display as the comment avatar - generally an antd Avatar
20+
* @type any ( string | slot)
21+
*/
22+
avatar?: VNodeChild | JSX.Element;
23+
24+
/** The main content of the comment
25+
* @type any ( string | slot)
26+
*/
27+
content?: VNodeChild | JSX.Element;
28+
29+
/** Comment prefix defaults to '.ant-comment'
30+
* @type string
31+
*/
32+
prefixCls?: string;
33+
34+
/** A datetime element containing the time to be displayed
35+
* @type any ( string | slot)
36+
*/
37+
datetime?: VNodeChild | JSX.Element;
38+
}
1939
}

types/timeline/timeline-item.d.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,23 @@
22
// Definitions by: akki-jat <https://github.com/akki-jat>
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

5+
import { VNodeChild } from 'vue';
56
import { AntdComponent } from '../component';
67

78
export declare class TimelineItem extends AntdComponent {
8-
/**
9-
* Set the circle's color to blue, red, green or other custom colors
10-
* @default 'blue'
11-
* @type string
12-
*/
13-
color: string;
9+
$props:{
10+
/**
11+
* Set the circle's color to blue, red, green or other custom colors
12+
* @default 'blue'
13+
* @type string
14+
*/
15+
color?: string;
1416

15-
/**
16-
* Customize timeline dot
17-
* @type any (string | slot)
18-
*/
19-
dot: any;
17+
/**
18+
* Customize timeline dot
19+
* @type any (string | slot)
20+
*/
21+
dot?: VNodeChild | JSX.Element;
22+
23+
}
2024
}

types/timeline/timeline.d.ts

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,40 @@
22
// Definitions by: akki-jat <https://github.com/akki-jat>
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

5+
import { VNodeChild } from 'vue';
56
import { AntdComponent } from '../component';
67
import { TimelineItem } from './timeline-item';
78

89
export declare class Timeline extends AntdComponent {
910
static Item: typeof TimelineItem;
1011

11-
/**
12-
* Set the last ghost node's existence or its content
13-
* @default false
14-
* @type any (boolean | string | slot)
15-
*/
16-
pending: any;
12+
$props:{
13+
/**
14+
* Set the last ghost node's existence or its content
15+
* @default false
16+
* @type any (boolean | string | slot)
17+
*/
18+
pending?: boolean | VNodeChild | JSX.Element;
1719

18-
/**
19-
* Set the dot of the last ghost node when pending is true
20-
* @default <LoadingOutlined />
21-
* @type any (string | slot)
22-
*/
23-
pendingDot: any;
20+
/**
21+
* Set the dot of the last ghost node when pending is true
22+
* @default <LoadingOutlined />
23+
* @type any (string | slot)
24+
*/
25+
pendingDot?: VNodeChild | JSX.Element;
2426

25-
/**
26-
* reverse nodes or not
27-
* @default false
28-
* @type boolean
29-
*/
30-
reverse: boolean;
27+
/**
28+
* reverse nodes or not
29+
* @default false
30+
* @type boolean
31+
*/
32+
reverse?: boolean;
3133

32-
/**
33-
* By sending alternate the timeline will distribute the nodes to the left and right.
34-
* @default 'left'
35-
* @type string
36-
*/
37-
mode: 'left' | 'alternate' | 'right';
34+
/**
35+
* By sending alternate the timeline will distribute the nodes to the left and right.
36+
* @default 'left'
37+
* @type string
38+
*/
39+
mode?: 'left' | 'alternate' | 'right';
40+
}
3841
}

0 commit comments

Comments
 (0)