chore: update types
parent
4636463fde
commit
01c0a03ac8
|
@ -32,7 +32,7 @@ import { Input } from './input/input';
|
|||
import { InputNumber } from './input-number';
|
||||
import { Layout } from './layout/layout';
|
||||
import { List } from './list/list';
|
||||
import { LocaleProvider } from './locale-provider';
|
||||
import { Space } from './space';
|
||||
import { Message } from './message';
|
||||
import { Mentions } from './mentions/mentions';
|
||||
import { Menu } from './menu/menu';
|
||||
|
@ -104,7 +104,7 @@ export {
|
|||
InputNumber,
|
||||
Layout,
|
||||
List,
|
||||
LocaleProvider,
|
||||
Space,
|
||||
message,
|
||||
Menu,
|
||||
Mentions,
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import { AntdComponent } from './component';
|
||||
import { CSSProperties } from 'vue';
|
||||
|
||||
export declare type Value = { key: string };
|
||||
|
||||
export declare type SelectValue = string | number | Value | Array<Value | string | number>;
|
||||
|
||||
export declare class AutoComplete extends AntdComponent {
|
||||
dropdownMenuStyle: object;
|
||||
$props: {
|
||||
dropdownMenuStyle: CSSProperties;
|
||||
/**
|
||||
* Show clear button, effective in multiple mode only.
|
||||
* @default false
|
||||
|
@ -96,7 +98,7 @@ export declare class AutoComplete extends AntdComponent {
|
|||
* @type boolean
|
||||
*/
|
||||
open: boolean;
|
||||
|
||||
};
|
||||
/**
|
||||
* remove focus
|
||||
*/
|
||||
|
|
|
@ -81,7 +81,7 @@ export declare class Card extends AntdComponent {
|
|||
* List of TabPane's head, Custom tabs can be created with the scopedSlots property
|
||||
* @type Array<{key: string, tab: any, scopedSlots: {tab: string}}>
|
||||
*/
|
||||
tabList?: Array<{ key: string; tab: any; scopedSlots: { tab: string } }>;
|
||||
tabList?: Array<{ key: string; tab: any; slots: { tab: string } }>;
|
||||
|
||||
/**
|
||||
* Card title
|
||||
|
|
|
@ -5,38 +5,40 @@
|
|||
import { AntdComponent } from '../component';
|
||||
|
||||
export declare class CollapsePanel extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* If true, panel cannot be opened or closed
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
disabled: boolean;
|
||||
disabled?: boolean;
|
||||
|
||||
/**
|
||||
* Forced render of content on panel, instead of lazy rending after clicking on header
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
forceRender: boolean;
|
||||
forceRender?: boolean;
|
||||
|
||||
/**
|
||||
* Title of the panel
|
||||
* @type string
|
||||
*/
|
||||
header: string;
|
||||
header?: string;
|
||||
|
||||
/**
|
||||
* Unique key identifying the panel from among its siblings
|
||||
* @type string
|
||||
*/
|
||||
key: string;
|
||||
key?: string;
|
||||
|
||||
/**
|
||||
* If false, panel will not show arrow icon
|
||||
* @default true
|
||||
* @type boolean
|
||||
*/
|
||||
showArrow: boolean;
|
||||
showArrow?: boolean;
|
||||
|
||||
extra: any;
|
||||
extra?: any;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,45 +7,46 @@ import { CollapsePanel } from './collapse-panel';
|
|||
export type ExpandIconPosition = 'left' | 'right';
|
||||
export declare class Collapse extends AntdComponent {
|
||||
static Panel: typeof CollapsePanel;
|
||||
|
||||
$props: {
|
||||
expandIconPosition?: ExpandIconPosition;
|
||||
/**
|
||||
* If true, Collapse renders as Accordion
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
accordion: boolean;
|
||||
accordion?: boolean;
|
||||
|
||||
/**
|
||||
* Key of the active panel
|
||||
* @default No default value. In accordion mode, it's the key of the first panel.
|
||||
* @type string | string[]
|
||||
*/
|
||||
activeKey: string | string[];
|
||||
activeKey?: string | string[];
|
||||
|
||||
/**
|
||||
* Toggles rendering of the border around the collapse block
|
||||
* @default true
|
||||
* @type boolean
|
||||
*/
|
||||
bordered: boolean;
|
||||
bordered?: boolean;
|
||||
|
||||
/**
|
||||
* Key of the initial active panel
|
||||
* @type string
|
||||
*/
|
||||
defaultActiveKey: string | string[];
|
||||
defaultActiveKey?: string | string[];
|
||||
|
||||
/**
|
||||
* Destroy Inactive Panel
|
||||
* @default false
|
||||
* @type boolean
|
||||
*/
|
||||
destroyInactivePanel: boolean;
|
||||
destroyInactivePanel?: boolean;
|
||||
|
||||
/**
|
||||
* allow to customize collapse icon.
|
||||
* @type any (function | slot-scope)
|
||||
*/
|
||||
expandIcon: any;
|
||||
expandIcon?: any;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import { AntdComponent } from './component';
|
|||
import Pickr from '@simonwep/pickr';
|
||||
|
||||
export declare class ColorPicker extends AntdComponent {
|
||||
$props: {
|
||||
/** simonwep/pickr's options */
|
||||
config?: Pickr.Options;
|
||||
/**prefix class name */
|
||||
|
@ -48,4 +49,5 @@ export declare class ColorPicker extends AntdComponent {
|
|||
* @default "HEXA"
|
||||
*/
|
||||
format: Pickr.Representation;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import { AntdComponent } from '../component';
|
||||
|
||||
export declare class TextArea extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* Height autosize feature, can be set to true|false or an object { minRows: 2, maxRows: 6 }
|
||||
* @default false
|
||||
|
@ -27,5 +28,6 @@ export declare class TextArea extends AntdComponent {
|
|||
*allow to remove input content with clear icon (1.5.0)
|
||||
* @type boolean
|
||||
*/
|
||||
allowClear?: boolean
|
||||
allowClear?: boolean;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,19 +7,6 @@ import { CSSProperties } from 'vue';
|
|||
import { AntdComponent } from '../component';
|
||||
|
||||
export interface LayoutFooterProps {
|
||||
/**
|
||||
* container className
|
||||
* @default undefined
|
||||
* @type string
|
||||
*/
|
||||
class?: string;
|
||||
|
||||
/**
|
||||
* to customize the styles
|
||||
* @type CSSProperties
|
||||
*/
|
||||
style?: CSSProperties;
|
||||
|
||||
/**
|
||||
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
|
||||
* @type boolean
|
||||
|
|
|
@ -7,19 +7,6 @@ import { CSSProperties } from 'vue';
|
|||
import { AntdComponent } from '../component';
|
||||
|
||||
export interface LayoutHeaderProps {
|
||||
/**
|
||||
* container className
|
||||
* @default undefined
|
||||
* @type string
|
||||
*/
|
||||
class?: string;
|
||||
|
||||
/**
|
||||
* to customize the styles
|
||||
* @type CSSProperties
|
||||
*/
|
||||
style?: CSSProperties;
|
||||
|
||||
/**
|
||||
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
|
||||
* @type boolean
|
||||
|
|
|
@ -6,12 +6,6 @@ import { CSSProperties, Slot, VNodeChild } from 'vue';
|
|||
import { AntdComponent } from '../component';
|
||||
|
||||
export interface LayoutSiderProps {
|
||||
/**
|
||||
* container className
|
||||
* @type string
|
||||
*/
|
||||
class?: string;
|
||||
|
||||
/**
|
||||
* whether can be collapsed
|
||||
* @default false
|
||||
|
@ -39,12 +33,6 @@ export interface LayoutSiderProps {
|
|||
*/
|
||||
reverseArrow?: boolean;
|
||||
|
||||
/**
|
||||
* to customize the styles
|
||||
* @type CSSProperties
|
||||
*/
|
||||
style?: CSSProperties;
|
||||
|
||||
/**
|
||||
* specify the customized trigger, set to null to hide the trigger
|
||||
* @type string | | VNodeChild | JSX.Element
|
||||
|
|
|
@ -10,19 +10,6 @@ import LayoutFooter from './layout-footer';
|
|||
import { CSSProperties } from 'vue';
|
||||
|
||||
export interface LayoutProps {
|
||||
/**
|
||||
* container className
|
||||
* @default undefined
|
||||
* @type string
|
||||
*/
|
||||
class?: string;
|
||||
|
||||
/**
|
||||
* to customize the styles
|
||||
* @type CSSProperties
|
||||
*/
|
||||
style?: CSSProperties;
|
||||
|
||||
/**
|
||||
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
|
||||
* @type boolean
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
// Project: https://github.com/vueComponent/ant-design-vue
|
||||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import { AntdComponent } from './component';
|
||||
|
||||
export interface ModalLocale {
|
||||
okText: string;
|
||||
cancelText: string;
|
||||
justOkText: string;
|
||||
}
|
||||
export interface Locale {
|
||||
locale: string;
|
||||
Pagination?: Object;
|
||||
DatePicker?: Object;
|
||||
TimePicker?: Object;
|
||||
Calendar?: Object;
|
||||
Table?: Object;
|
||||
Modal?: ModalLocale;
|
||||
Popconfirm?: Object;
|
||||
Transfer?: Object;
|
||||
Select?: Object;
|
||||
Upload?: Object;
|
||||
}
|
||||
|
||||
export declare class LocaleProvider extends AntdComponent {
|
||||
/**
|
||||
* language package setting, you can find the packages in this path: antd/lib/locale-provider/
|
||||
* @type object
|
||||
*/
|
||||
locale: object;
|
||||
}
|
|
@ -18,5 +18,5 @@ export declare class MenuItemGroup extends AntdComponent {
|
|||
* @type string | slot
|
||||
*/
|
||||
title?: VNodeChild | JSX.Element;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ export interface ModalOptions {
|
|||
/**
|
||||
* Style of floating layer, typically used at least for adjusting the position.
|
||||
*/
|
||||
dialogStyle?: CSSProperties
|
||||
dialogStyle?: CSSProperties;
|
||||
/**
|
||||
* className of floating layer.
|
||||
*/
|
||||
|
@ -299,7 +299,7 @@ export declare class Modal extends AntdComponent {
|
|||
* @type number
|
||||
*/
|
||||
zIndex?: number;
|
||||
}
|
||||
};
|
||||
static info(options: ModalOptions): ModalConfirm;
|
||||
static success(options: ModalOptions): ModalConfirm;
|
||||
static error(options: ModalOptions): ModalConfirm;
|
||||
|
@ -307,13 +307,3 @@ export declare class Modal extends AntdComponent {
|
|||
static confirm(options: ModalOptions): ModalConfirm;
|
||||
static destroyAll(): void;
|
||||
}
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
$info: (modalOptios: ModalOptions) => ModalConfirm;
|
||||
$success: (modalOptios: ModalOptions) => ModalConfirm;
|
||||
$error: (modalOptios: ModalOptions) => ModalConfirm;
|
||||
$warning: (modalOptios: ModalOptions) => ModalConfirm;
|
||||
$confirm: (modalOptios: ModalOptions) => ModalConfirm;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import { AntdComponent } from './component';
|
||||
import { VNodeChild, CSSProperties } from 'vue';
|
||||
export type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
||||
export interface NotificationOptions extends NotificationConfigOptions {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
import { AntdComponent } from './component';
|
||||
export type SizeType = 'small' | 'middle' | 'large' | undefined;
|
||||
export declare class Space extends AntdComponent {
|
||||
$props: {
|
||||
prefixCls?: string;
|
||||
size?: SizeType | number;
|
||||
direction?: 'horizontal' | 'vertical';
|
||||
// No `stretch` since many components do not support that.
|
||||
align?: 'start' | 'end' | 'center' | 'baseline';
|
||||
};
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import { VNodeChild, Slots } from 'vue';
|
||||
import { VNodeChild } from 'vue';
|
||||
import { AntdComponent } from '../component';
|
||||
|
||||
export declare class ColumnGroup extends AntdComponent {
|
||||
|
@ -12,12 +12,5 @@ export declare class ColumnGroup extends AntdComponent {
|
|||
* @type any
|
||||
*/
|
||||
title?: VNodeChild | JSX.Element;
|
||||
|
||||
/**
|
||||
* When using columns, you can use this property to configure the properties that support the slot,
|
||||
* such as slots: { title: 'XXX'}
|
||||
* @type object
|
||||
*/
|
||||
slots?: Slots;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ export interface ColumnProps<T> {
|
|||
* such as slots: { filterIcon: 'XXX'}
|
||||
* @type object
|
||||
*/
|
||||
slots?: { [key: string]: string };
|
||||
slots?: Record<string, string>;
|
||||
}
|
||||
|
||||
export declare class Column<T> extends AntdComponent {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Definitions by: akki-jat <https://github.com/akki-jat>
|
||||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import Vue, { VNodeChild } from 'vue';
|
||||
import { VNodeChild } from 'vue';
|
||||
import { AntdComponent } from '../component';
|
||||
import { TooltipCommon } from './common';
|
||||
|
||||
|
@ -12,6 +12,6 @@ export declare class Tooltip extends AntdComponent {
|
|||
* The text shown in the tooltip
|
||||
* @type any (string | slot)
|
||||
*/
|
||||
title: VNodeChild | JSX.Element
|
||||
} & TooltipCommon
|
||||
title: VNodeChild | JSX.Element;
|
||||
} & TooltipCommon;
|
||||
}
|
||||
|
|
|
@ -7,20 +7,6 @@ import { VNodeChild } from 'vue';
|
|||
|
||||
export declare class TreeNode extends AntdComponent {
|
||||
$props: {
|
||||
/**
|
||||
* Class
|
||||
* @description className
|
||||
* @type string
|
||||
*/
|
||||
class?: string;
|
||||
|
||||
/**
|
||||
* Style
|
||||
* @description style of tree node
|
||||
* @type string | object
|
||||
*/
|
||||
style?: string | object;
|
||||
|
||||
/**
|
||||
* When Tree is checkable, set TreeNode display Checkbox or not
|
||||
* @version 1.5.0
|
||||
|
@ -90,19 +76,5 @@ export declare class TreeNode extends AntdComponent {
|
|||
* @type string
|
||||
*/
|
||||
value?: string;
|
||||
|
||||
/**
|
||||
* Slots
|
||||
* @description When using treeNodes, you can use this property to configure the properties that support the slot,
|
||||
* such as slots: { title: 'XXX'}
|
||||
* @type object
|
||||
*/
|
||||
slots?: object;
|
||||
|
||||
/**
|
||||
* When using treeNodes, you can use this property to configure the events,
|
||||
* such as on: { click: () => {}}
|
||||
*/
|
||||
on?: object;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,12 +8,21 @@ import { VNodeChild, CSSProperties } from 'vue';
|
|||
|
||||
export interface TreeData {
|
||||
key: string | number;
|
||||
title: string | VNodeChild | JSX.Element;
|
||||
value: string;
|
||||
label: any;
|
||||
children: any;
|
||||
label?: any;
|
||||
children?: object[];
|
||||
disabled?: boolean;
|
||||
disableCheckbox?: boolean;
|
||||
selectable?: boolean;
|
||||
checkable?: boolean;
|
||||
/**
|
||||
* Slots
|
||||
* @description When using treeNodes, you can use this property to configure the properties that support the slot,
|
||||
* such as slots: { title: 'XXX'}
|
||||
* @type object
|
||||
*/
|
||||
slots?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ReplaceFields {
|
||||
|
|
|
@ -3,15 +3,16 @@
|
|||
// Definitions: https://github.com/vueComponent/ant-design-vue/types
|
||||
|
||||
import { AntdComponent } from '../component';
|
||||
import { Tree } from './tree';
|
||||
import { TreeProps } from './tree';
|
||||
|
||||
export declare class DictionaryTree extends Tree {
|
||||
$props: {
|
||||
interface DictionaryTreeProps extends TreeProps {
|
||||
/**
|
||||
* Directory open logic, optional `false` 'click' 'dblclick'
|
||||
* @default 'click'
|
||||
* @type string
|
||||
*/
|
||||
expandAction?: string | boolean;
|
||||
};
|
||||
}
|
||||
export declare class DictionaryTree extends AntdComponent {
|
||||
$props: DictionaryTreeProps;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,9 @@
|
|||
import { AntdComponent } from '../component';
|
||||
import { TreeNode } from '../tree-node';
|
||||
import { DictionaryTree } from './dictionary-tree';
|
||||
|
||||
export declare class Tree extends AntdComponent {
|
||||
static TreeNode: typeof TreeNode;
|
||||
static DirectoryTree: typeof DictionaryTree;
|
||||
|
||||
$props: {
|
||||
import { TreeData } from '../tree-select';
|
||||
import { VNode } from 'vue';
|
||||
export interface TreeProps {
|
||||
/**
|
||||
* Whether treeNode fill remaining horizontal space
|
||||
* @version 1.5.0
|
||||
|
@ -25,7 +22,7 @@ export declare class Tree extends AntdComponent {
|
|||
* treeNode of tree
|
||||
* @type TreeNode[]
|
||||
*/
|
||||
treeData?: TreeNode[];
|
||||
treeData?: TreeData[];
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -141,13 +138,13 @@ export declare class Tree extends AntdComponent {
|
|||
* When the function returns true, the corresponding treeNode will be highlighted
|
||||
* @type Function
|
||||
*/
|
||||
filterTreeNode?: (node?: TreeNode) => any;
|
||||
filterTreeNode?: (node?: VNode) => any | boolean;
|
||||
|
||||
/**
|
||||
* Load data asynchronously
|
||||
* @type Function
|
||||
*/
|
||||
loadData?: (node?: TreeNode) => any;
|
||||
loadData?: (node?: VNode) => any;
|
||||
|
||||
/**
|
||||
* (Controlled) Set loaded tree nodes. Need work with loadData
|
||||
|
@ -269,5 +266,10 @@ export declare class Tree extends AntdComponent {
|
|||
* @param event
|
||||
*/
|
||||
onSelect?: (selectedKeys: string[], event: { selected; selectedNodes; node; event }) => void;
|
||||
};
|
||||
}
|
||||
export declare class Tree extends AntdComponent {
|
||||
static TreeNode: typeof TreeNode;
|
||||
static DirectoryTree: typeof DictionaryTree;
|
||||
|
||||
$props: TreeProps;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue