bump 2.0.0-beta.8

fix: types error
pull/2809/head 2.0.0-beta.8
tanjinzhou 2020-09-08 13:33:55 +08:00
parent b25eb6742a
commit f84065dcd3
19 changed files with 115 additions and 90 deletions

View File

@ -7,4 +7,3 @@ es/
lib/
_site/
dist/
types/

View File

@ -19,6 +19,14 @@
"rules": {
"no-console": "off"
}
},
{
"files": ["**/types/**/*.ts"],
"extends": ["@vue/typescript/recommended"],
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/ban-types": 0
}
}
],
"rules": {

View File

@ -10,6 +10,10 @@
---
## 2.0.0-beta.8
- 🐞 Fix ts types error
## 2.0.0-beta.7
- 🐞 Fix the problem that Descriptions Item does not support v-for [#2793](https://github.com/vueComponent/ant-design-vue/issues/2793)

View File

@ -10,6 +10,10 @@
---
## 2.0.0-beta.8
- 🐞 修复 ts 类型错误
## 2.0.0-beta.7
- 🐞 修复 Descriptions Item 不支持 v-for 问题 [#2793](https://github.com/vueComponent/ant-design-vue/issues/2793)

View File

@ -1,6 +1,6 @@
{
"name": "ant-design-vue",
"version": "2.0.0-beta.7",
"version": "2.0.0-beta.8",
"title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [
@ -41,6 +41,7 @@
"pretty-quick": "pretty-quick",
"dist": "node antd-tools/cli/run.js dist",
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
"lint:types": "eslint -c ./.eslintrc --fix --ext .ts ./types",
"lint:site": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./antdv-demo",
"lint:docs": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue,.md ./antdv-demo/docs/**/demo/**",
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
@ -78,9 +79,12 @@
"@commitlint/cli": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"@octokit/rest": "^16.0.0",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"@vue/babel-plugin-jsx": "^1.0.0-rc.2",
"@vue/cli-plugin-eslint": "^4.0.0",
"@vue/compiler-sfc": "^3.0.0-rc.5",
"@vue/eslint-config-typescript": "^5.1.0",
"@vue/server-test-utils": "1.0.0-beta.16",
"@vue/test-utils": "^2.0.0-beta.2",
"acorn": "^7.0.0",

13
tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
"jsx": "preserve",
"esModuleInterop": true
},
"include": ["./types"],
"exclude": ["node_modules", "build", "scripts", "components", "webpack", "jest"]
}

View File

@ -9,7 +9,7 @@ export declare class BreadcrumbItem extends AntdComponent {
* @default ''
* @type string
*/
href?: String;
href?: string;
overlay?: any;
};
}

View File

@ -8,8 +8,8 @@ import { BreadcrumbSeparator } from './breadcrumb-separator';
import { AntdComponent, AntdProps } from '../component';
export interface Route {
path?: String;
breadcrumbName?: String;
path?: string;
breadcrumbName?: string;
children?: Route[];
}

View File

@ -6,71 +6,72 @@ import { ButtonGroup } from './button-group';
import { VNodeChild } from 'vue';
import { AntdComponent, AntdProps } from '../component';
export interface ButtonProps extends AntdProps {
/**
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)
* @default 'default'
* @type string
*/
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
/**
* set the original html type of button
* @default 'button'
* @type string
*/
htmlType?: 'button' | 'submit' | 'reset' | 'menu';
/**
* set the icon of button
* @type string
*/
icon?: VNodeChild | JSX.Element;
/**
* can be set to circle or circle-outline or omitted
* @type string
*/
shape?: 'circle' | 'circle-outline';
/**
* can be set to small large or omitted
* @default 'default'
* @type string
*/
size?: 'small' | 'large' | 'default';
/**
* set the loading status of button
* @default false
* @type boolean | { delay: number }
*/
loading?: boolean | { delay: number };
/**
* disabled state of button
* @default false
* @type boolean
*/
disabled?: boolean;
/**
* make background transparent and invert text and border colors, added in 2.7
* @default false
* @type boolean
*/
ghost?: boolean;
/**
* option to fit button width to its parent width
* @default false
* @type boolean
*/
block?: boolean;
onClick?: (e?: Event) => void;
}
export declare class Button extends AntdComponent {
static Group: typeof ButtonGroup;
$props: AntdProps & {
/**
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default)
* @default 'default'
* @type string
*/
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
/**
* set the original html type of button
* @default 'button'
* @type string
*/
htmlType?: 'button' | 'submit' | 'reset' | 'menu';
/**
* set the icon of button
* @type string
*/
icon?: VNodeChild | JSX.Element;
/**
* can be set to circle or circle-outline or omitted
* @type string
*/
shape?: 'circle' | 'circle-outline';
/**
* can be set to small large or omitted
* @default 'default'
* @type string
*/
size?: 'small' | 'large' | 'default';
/**
* set the loading status of button
* @default false
* @type boolean | { delay: number }
*/
loading?: boolean | { delay: number };
/**
* disabled state of button
* @default false
* @type boolean
*/
disabled?: boolean;
/**
* make background transparent and invert text and border colors, added in 2.7
* @default false
* @type boolean
*/
ghost?: boolean;
/**
* option to fit button width to its parent width
* @default false
* @type boolean
*/
block?: boolean;
onClick?: (e?: Event) => void;
};
$props: ButtonProps;
}

View File

@ -8,4 +8,4 @@ export declare class AntdComponent {
static install(app: App): void;
}
export interface AntdProps extends HTMLAttributes {}
export type AntdProps = HTMLAttributes

View File

@ -4,7 +4,7 @@
import { Moment } from 'moment';
import { VNodeChild } from 'vue';
import { AntdComponent, AntdProps } from '../component';
import { AntdComponent } from '../component';
export declare class DatepickerProps {
/**

View File

@ -1,4 +1,3 @@
import { CSSProperties } from 'vue';
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: Pythonfo <https://github.com/Pythonfo>
// Copy from: akki-jat <https://github.com/akki-jat>

View File

@ -1,4 +1,3 @@
import { CSSProperties } from 'vue';
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: Pythonfo <https://github.com/Pythonfo>
// Copy from: akki-jat <https://github.com/akki-jat>

View File

@ -1,4 +1,4 @@
import { CSSProperties, Slot, VNodeChild } from 'vue';
import { VNodeChild } from 'vue';
// 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

View File

@ -7,7 +7,6 @@ import { LayoutSider } from './layout-sider';
import LayoutHeader from './layout-header';
import LayoutContent from './layout-content';
import LayoutFooter from './layout-footer';
import { CSSProperties } from 'vue';
export interface LayoutProps {
/**

View File

@ -3,7 +3,6 @@
// Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent, AntdProps } from '../component';
import { MenuItem } from './menu-item';
import { VNodeChild } from 'vue';
export declare class SubMenu extends AntdComponent {

19
types/modal.d.ts vendored
View File

@ -3,9 +3,8 @@
// Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent, AntdProps } from './component';
import { VNode, CSSProperties, VNodeChild } from 'vue';
import { TreeNode } from './tree-node';
import { Button } from './button/button';
import { CSSProperties, VNodeChild } from 'vue';
import { ButtonProps } from './button/button';
export interface ModalOptions {
/**
@ -43,7 +42,7 @@ export interface ModalOptions {
/**
* custom icon (Added in 1.14.0)
*/
icon?: VNode | Function;
icon?: VNodeChild | JSX.Element | function;
/**
* Whether show mask or not.
* @default true
@ -82,13 +81,13 @@ export interface ModalOptions {
* The ok button props
* @type object
*/
okButtonProps?: Button.$props;
okButtonProps?: ButtonProps;
/**
* The cancel button props
* @type object
*/
cancelButtonProps?: Button.$props;
cancelButtonProps?: ButtonProps;
/**
* Title
@ -133,10 +132,6 @@ export interface ModalOptions {
* @type Function
*/
onOk?: () => any;
/**
* The parent context of the popup is generally used to get the parent provider, such as the configuration of ConfigProvider
*/
parentContext?: object;
}
export interface ModalConfirm {
@ -259,13 +254,13 @@ export declare class Modal extends AntdComponent {
* The ok button props, follow jsx rules
* @type object
*/
okButtonProps?: Button.$props;
okButtonProps?: ButtonProps;
/**
* The cancel button props, follow jsx rules
* @type object
*/
cancelButtonProps?: Button.$props;
cancelButtonProps?: ButtonProps;
/**
* The modal dialog's title

View File

@ -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, AntdProps } from '../component';
export interface ColumnFilterItem {

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
export const tuple = <T extends string[]>(...args: T) => args;