Skip to content

Commit 4556212

Browse files
author
binhaoCen
authored
chore: update type message (#2718)
* chore: update type message * chore: update type input-number
1 parent 23f6116 commit 4556212

File tree

2 files changed

+73
-74
lines changed

2 files changed

+73
-74
lines changed

types/input-number.d.ts

+68-66
Original file line numberDiff line numberDiff line change
@@ -5,81 +5,83 @@
55
import { AntdComponent } from './component';
66

77
export declare class InputNumber extends AntdComponent {
8-
/**
9-
* get focus when component mounted
10-
* @default false
11-
* @type boolean
12-
*/
13-
autofocus: boolean;
8+
$props: {
9+
/**
10+
* get focus when component mounted
11+
* @default false
12+
* @type boolean
13+
*/
14+
autofocus?: boolean;
1415

15-
/**
16-
* initial value
17-
* @type number | string
18-
*/
19-
defaultValue: number | string;
16+
/**
17+
* initial value
18+
* @type number | string
19+
*/
20+
defaultValue?: number | string;
2021

21-
/**
22-
* disable the input
23-
* @default false
24-
* @type boolean
25-
*/
26-
disabled: boolean;
22+
/**
23+
* disable the input
24+
* @default false
25+
* @type boolean
26+
*/
27+
disabled?: boolean;
2728

28-
/**
29-
* Specifies the format of the value presented
30-
* @type Function
31-
*/
32-
formatter: (value: number | string) => string;
29+
/**
30+
* Specifies the format of the value presented
31+
* @type Function
32+
*/
33+
formatter?: (value: number | string) => string;
3334

34-
/**
35-
* max value
36-
* @default Infinity
37-
* @type number
38-
*/
39-
max: number;
35+
/**
36+
* max value
37+
* @default Infinity
38+
* @type number
39+
*/
40+
max?: number;
4041

41-
/**
42-
* mix value
43-
* @default Infinity
44-
* @type number
45-
*/
46-
min: number;
42+
/**
43+
* mix value
44+
* @default -Infinity
45+
* @type number
46+
*/
47+
min?: number;
4748

48-
/**
49-
* Specifies the value extracted from formatter
50-
* @type Function
51-
*/
52-
parser: (string: string) => number;
49+
/**
50+
* Specifies the value extracted from formatter
51+
* @type Function
52+
*/
53+
parser?: (string: string) => number;
5354

54-
/**
55-
* precision of input value
56-
* @type number
57-
*/
58-
precision: number;
55+
/**
56+
* precision of input value
57+
* @type number
58+
*/
59+
precision?: number;
5960

60-
/**
61-
* decimal separator
62-
* @type string
63-
*/
64-
decimalSeparator: string;
61+
/**
62+
* decimal separator
63+
* @type string
64+
*/
65+
decimalSeparator?: string;
6566

66-
/**
67-
* width of input box
68-
* @default 'default'
69-
* @type string
70-
*/
71-
size: 'large' | 'small' | 'default';
67+
/**
68+
* width of input box
69+
* @default 'default'
70+
* @type string
71+
*/
72+
size?: 'large' | 'small' | 'default';
7273

73-
/**
74-
* The number to which the current value is increased or decreased. It can be an integer or decimal.
75-
* @default 1
76-
* @type number | string
77-
*/
78-
step: number | string;
74+
/**
75+
* The number to which the current value is increased or decreased. It can be an integer or decimal.
76+
* @default 1
77+
* @type number | string
78+
*/
79+
step?: number | string;
7980

80-
/**
81-
* current value
82-
* @type number | string
83-
*/
84-
value: number | string;
81+
/**
82+
* current value
83+
* @type number | string
84+
*/
85+
value?: number | string;
86+
}
8587
}

types/message.d.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Definitions by: akki-jat <https://github.com/akki-jat>
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

5-
import { VNode, CreateElement } from 'vue';
5+
import { VNodeChild } from 'vue';
66

77
export interface ThenableArgument {
88
(val: any): void;
@@ -12,7 +12,7 @@ export interface MessageType {
1212
then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>;
1313
promise: Promise<void>;
1414
}
15-
export type ConfigType = VNode | ((h: CreateElement) => VNode);
15+
export type ConfigType = VNodeChild | (() => VNodeChild);
1616
export type ConfigDuration = number | (() => void);
1717
export type ConfigOnClose = () => void;
1818

@@ -47,6 +47,9 @@ export interface MessageOptions {
4747
* @type Function
4848
*/
4949
onClose?: ConfigOnClose;
50+
/**
51+
* The unique identifier of the Message
52+
*/
5053
key?: string | number;
5154
}
5255

@@ -96,9 +99,3 @@ export declare interface Message {
9699
config: (options: MessageConfigOptions) => void;
97100
destroy: () => void;
98101
}
99-
100-
declare module 'vue/types/vue' {
101-
interface Vue {
102-
$message: Message;
103-
}
104-
}

0 commit comments

Comments
 (0)