Add TypeScript definitions (#3910)

* add typings into package.json

* add typings for global instance api

* add common component definition

* add layout components' definition

* add icons definition

* add component size definition

* add component description

* add button definition

* add radio definition

* add checkbox definition

* add input definitions

* add input-number definition

* add select definition

* add cascader definition

* add switch definition

* add slider definition

* add time picker definition

* add date picker definition

* add upload definition

* add rate definition

* add color picker definition

* add form definition

* add tooltip definition

* add table definition

* rename TextAlignment to Horizontal alignment

* add tag definition

* add progress definition

* add tree definition

* add pagination definition

* add badge definition

* add alert definition

* fix typo

* Loading: add definition

* Message: add definition

* Loading: remove unnecessary declare keyword

* MessageBox: add definition

* Notification: add definition

* Menu: add definition

* Tabs: add definition

* Breadcrumb: add definition

* Dropdown: add definition

* Steps: add definition

* Dialog: add definition

* Popover: add definition

* Card: add definition

* Carousel: add definition

* Collapse: add definition

* Loading: update description

* some $message method params should be optional

* Select: update definition

* DatePicker: update definition
This commit is contained in:
Jingkun Hua
2017-10-17 16:36:12 +08:00
committed by 杨奕
parent 55bc6f35ba
commit 3b378ad58f
62 changed files with 2515 additions and 1 deletions

34
types/button.d.ts vendored Normal file
View File

@@ -0,0 +1,34 @@
import { ElementUIComponent, ElementUIComponentSize } from './component'
/** Button type */
export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
/** Same as native button's type */
export type ButtonNativeType = 'button' | 'submit' | 'reset' | 'menu'
/** Button Component */
export declare class ElButton extends ElementUIComponent {
/** Button size */
size: ElementUIComponentSize
/** Button type */
type: ButtonType
/** Determine whether it's a plain button */
plain: Boolean
/** Determine whether it's loading */
loading: Boolean
/** Disable the button */
disabled: boolean
/** Button icon, accepts an icon name of Element icon component */
icon: string
/** Same as native button's autofocus */
autofocus: boolean
/** Same as native button's type */
nativeType: ButtonNativeType
}