From 45562123d448df6bde7ef9c4afe784913684735d Mon Sep 17 00:00:00 2001 From: binhaoCen Date: Wed, 19 Aug 2020 18:55:32 +0800 Subject: [PATCH] chore: update type message (#2718) * chore: update type message * chore: update type input-number --- types/input-number.d.ts | 134 ++++++++++++++++++++-------------------- types/message.d.ts | 13 ++-- 2 files changed, 73 insertions(+), 74 deletions(-) diff --git a/types/input-number.d.ts b/types/input-number.d.ts index d103c55ed..0368c2462 100644 --- a/types/input-number.d.ts +++ b/types/input-number.d.ts @@ -5,81 +5,83 @@ import { AntdComponent } from './component'; export declare class InputNumber extends AntdComponent { - /** - * get focus when component mounted - * @default false - * @type boolean - */ - autofocus: boolean; + $props: { + /** + * get focus when component mounted + * @default false + * @type boolean + */ + autofocus?: boolean; - /** - * initial value - * @type number | string - */ - defaultValue: number | string; + /** + * initial value + * @type number | string + */ + defaultValue?: number | string; - /** - * disable the input - * @default false - * @type boolean - */ - disabled: boolean; + /** + * disable the input + * @default false + * @type boolean + */ + disabled?: boolean; - /** - * Specifies the format of the value presented - * @type Function - */ - formatter: (value: number | string) => string; + /** + * Specifies the format of the value presented + * @type Function + */ + formatter?: (value: number | string) => string; - /** - * max value - * @default Infinity - * @type number - */ - max: number; + /** + * max value + * @default Infinity + * @type number + */ + max?: number; - /** - * mix value - * @default Infinity - * @type number - */ - min: number; + /** + * mix value + * @default -Infinity + * @type number + */ + min?: number; - /** - * Specifies the value extracted from formatter - * @type Function - */ - parser: (string: string) => number; + /** + * Specifies the value extracted from formatter + * @type Function + */ + parser?: (string: string) => number; - /** - * precision of input value - * @type number - */ - precision: number; + /** + * precision of input value + * @type number + */ + precision?: number; - /** - * decimal separator - * @type string - */ - decimalSeparator: string; + /** + * decimal separator + * @type string + */ + decimalSeparator?: string; - /** - * width of input box - * @default 'default' - * @type string - */ - size: 'large' | 'small' | 'default'; + /** + * width of input box + * @default 'default' + * @type string + */ + size?: 'large' | 'small' | 'default'; - /** - * The number to which the current value is increased or decreased. It can be an integer or decimal. - * @default 1 - * @type number | string - */ - step: number | string; + /** + * The number to which the current value is increased or decreased. It can be an integer or decimal. + * @default 1 + * @type number | string + */ + step?: number | string; - /** - * current value - * @type number | string - */ - value: number | string; + /** + * current value + * @type number | string + */ + value?: number | string; + } } diff --git a/types/message.d.ts b/types/message.d.ts index eab427a1d..b63dd27a3 100644 --- a/types/message.d.ts +++ b/types/message.d.ts @@ -2,7 +2,7 @@ // Definitions by: akki-jat // Definitions: https://github.com/vueComponent/ant-design-vue/types -import { VNode, CreateElement } from 'vue'; +import { VNodeChild } from 'vue'; export interface ThenableArgument { (val: any): void; @@ -12,7 +12,7 @@ export interface MessageType { then: (fill: ThenableArgument, reject: ThenableArgument) => Promise; promise: Promise; } -export type ConfigType = VNode | ((h: CreateElement) => VNode); +export type ConfigType = VNodeChild | (() => VNodeChild); export type ConfigDuration = number | (() => void); export type ConfigOnClose = () => void; @@ -47,6 +47,9 @@ export interface MessageOptions { * @type Function */ onClose?: ConfigOnClose; + /** + * The unique identifier of the Message + */ key?: string | number; } @@ -96,9 +99,3 @@ export declare interface Message { config: (options: MessageConfigOptions) => void; destroy: () => void; } - -declare module 'vue/types/vue' { - interface Vue { - $message: Message; - } -}