Skip to content

Commit

Permalink
Merge pull request #354 from xiyifenheart/element3.d.ts-change
Browse files Browse the repository at this point in the history
fix: change d.ts
  • Loading branch information
cuixiaorui authored Nov 14, 2020
2 parents 5c9310c + bacf2ae commit 469433b
Show file tree
Hide file tree
Showing 37 changed files with 86 additions and 38 deletions.
6 changes: 4 additions & 2 deletions build/bin/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ describe('${ComponentName}', () => {
content: `import { ElementUIComponent } from './component'
/** ${ComponentName} Component */
export declare class El${ComponentName} extends ElementUIComponent {
}`
interface I${ComponentName} extends ElementUIComponent {
}
export const El${ComponentName}:I${ComponentName}`
}
]

Expand Down
3 changes: 2 additions & 1 deletion types/backtop.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElBacktop:IBacktop
/** Backtop Component */
export declare class ElBacktop extends ElementUIComponent {
interface IBacktop extends ElementUIComponent {
/** Backtop target */
target: string

Expand Down
3 changes: 2 additions & 1 deletion types/calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { ElementUIComponent } from './component'

export type DateType = Date | String | Number

export const ElCalendar:ICalendar
/** Calendar Component */
export declare class ElCalendar extends ElementUIComponent {
interface ICalendar extends ElementUIComponent {
/** Binding value */
value: DateType

Expand Down
3 changes: 2 additions & 1 deletion types/cascader-panel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export interface CascaderPanelSlots {
[key: string]: VNode[]
}

export const ElCascaderPanel:ICascaderPanel
/** CascaderPanel Component */
export declare class ElCascaderPanel<V = any, D = CascaderOption> extends ElementUIComponent {
interface ICascaderPanel<V = any, D = CascaderOption> extends ElementUIComponent {
/** Selected value */
value: V | V[]

Expand Down
4 changes: 3 additions & 1 deletion types/collapse-item.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface CollapseItemSlots {
}

/** Collapse Item Component */
export declare class ElCollapseItem extends ElementUIComponent {
interface ICollapseItem extends ElementUIComponent {
/** Unique identification of the panel */
name: string | number

Expand All @@ -24,3 +24,5 @@ export declare class ElCollapseItem extends ElementUIComponent {
/** Disable the collapse item */
disabled: boolean
}

export const ElCollapseItem:ICollapseItem
4 changes: 3 additions & 1 deletion types/collapse.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { ElementUIComponent } from './component'

/** Use Collapse to store contents. */
export declare class ElCollapse extends ElementUIComponent {
interface ICollapse extends ElementUIComponent{
/** Whether to activate accordion mode */
accordion: boolean

/** Currently active panel */
value: string | number | string[] | number[]
}

export const ElCollapse:ICollapse
4 changes: 3 additions & 1 deletion types/color-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ElementUIComponent, ElementUIComponentSize } from './component'
export type ColorFormat = 'hsl' | 'hsv' | 'hex' | 'rgb'

/** ColorPicker Component */
export declare class ElColorPicker extends ElementUIComponent {
interface IColorPicker extends ElementUIComponent {
/** Whether to display the alpha slider */
showAlpha: boolean

Expand All @@ -19,3 +19,5 @@ export declare class ElColorPicker extends ElementUIComponent {
/** Custom class name for ColorPicker's dropdown */
colorFormat: ColorFormat
}

export const ElColorPicker:IColorPicker
4 changes: 3 additions & 1 deletion types/date-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface DatePickerOptions {
}

/** DatePicker Component */
export declare class ElDatePicker extends ElementUIComponent {
interface IDatePicker extends ElementUIComponent {
/** The value of the date picker */
value: Date | string | Date[] | string[]

Expand Down Expand Up @@ -122,3 +122,5 @@ export declare class ElDatePicker extends ElementUIComponent {
*/
focus (): void
}

export const ElDatePicker:IDatePicker
4 changes: 3 additions & 1 deletion types/dialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface DialogSlots {
}

/** Informs users while preserving the current page state */
export declare class ElDialog extends ElementUIComponent {
interface IDialog extends ElementUIComponent {
/** Title of Dialog */
title: string

Expand Down Expand Up @@ -60,3 +60,5 @@ export declare class ElDialog extends ElementUIComponent {

$slots: DialogSlots
}

export const ElDialog:IDialog
3 changes: 2 additions & 1 deletion types/divider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { ElementUIComponent } from './component'

export type ContentPosition = 'left' | 'center' | 'right'

export const ElDivider:IDivider
/** Divider Component */
export declare class ElDivider extends ElementUIComponent {
interface IDivider extends ElementUIComponent {
/** enable vertical divider */
vertical: boolean

Expand Down
4 changes: 3 additions & 1 deletion types/drawer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ interface DrawerSlots {

[key: string]: VNode[]
}

export const ElDrawer:IDrawer
/** Drawer Component */
export declare class ElDrawer extends ElementUIComponent {
interface IDrawer extends ElementUIComponent {
/* Equivalent to `Dialog`'s append to body attribute, when applying nested drawer, make sure this one is set to true */
appendToBody: boolean

Expand Down
4 changes: 3 additions & 1 deletion types/dropdown-item.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ElementUIComponent } from './component'

/** Toggleable menu for displaying lists of links and actions. */
export declare class ElDropdownItem extends ElementUIComponent {
interface IDropdownItem extends ElementUIComponent {
/** A command to be dispatched to Dropdown's command callback */
command: string | number | object

Expand All @@ -14,3 +14,5 @@ export declare class ElDropdownItem extends ElementUIComponent {
/** Icon to show on left side of text */
icon: string
}

export const ElDropdownItem:IDropdownItem
4 changes: 3 additions & 1 deletion types/dropdown-menu.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ElementUIComponent } from './component'

/** Dropdown Menu Component */
export declare class ElDropdownMenu extends ElementUIComponent {}
interface IDropdownMenu extends ElementUIComponent {}

export const ElDropdownMenu:IDropdownMenu
4 changes: 3 additions & 1 deletion types/dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type DropdownMenuAlignment = 'top' | 'top-start' | 'top-end' | 'bottom' |
export type DropdownMenuTrigger = 'hover' | 'click'

/** Toggleable menu for displaying lists of links and actions */
export declare class ElDropdown extends ElementUIComponent {
interface IDropdown extends ElementUIComponent {
/** Menu button type. only works when split-button is true */
type: ButtonType

Expand Down Expand Up @@ -33,3 +33,5 @@ export declare class ElDropdown extends ElementUIComponent {
/** Dropdown tabindex */
tabindex: number
}

export const ElDropdown:IDropdown
2 changes: 1 addition & 1 deletion types/element3.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export { useLoading } from './loading'
export { useMsgbox } from './message-box'
export { ElSteps } from './steps'
export { ElUpload } from './upload'

import { ElCollapse } from './collapse'
import { ElCollapseItem } from './collapse-item'
import { ElColorPicker } from './color-picker'
Expand All @@ -57,6 +56,7 @@ import { ElDropdownItem } from './dropdown-item'
import { ElDropdownMenu } from './dropdown-menu'
import { ElForm } from './form'
import { ElFormItem } from './form-item'

import { ElInput } from './input'
import { ElInputNumber } from './input-number'
import { ElLoading } from './loading'
Expand Down
4 changes: 3 additions & 1 deletion types/form-item.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ElementUIComponent, ElementUIComponentSize } from './component'

/** FormItem Component */
export declare class ElFormItem extends ElementUIComponent {
interface IFormItem extends ElementUIComponent {
/** A key of `model` of the enclosing `el-form` component */
prop: string

Expand Down Expand Up @@ -35,3 +35,5 @@ export declare class ElFormItem extends ElementUIComponent {
/** Remove validation status of the field */
clearValidate (): void
}

export const ElFormItem:IFormItem
4 changes: 3 additions & 1 deletion types/form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ValidateFieldCallback {
}

/** Form Component */
export declare class ElForm extends ElementUIComponent {
interface IForm extends ElementUIComponent {
/** Data of form component */
model: object

Expand Down Expand Up @@ -80,3 +80,5 @@ export declare class ElForm extends ElementUIComponent {
/** clear validation message for certain fields */
clearValidate (props?: string | string[]): void
}

export const ElForm:IForm
3 changes: 2 additions & 1 deletion types/image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export interface ImageSlots {
[key: string]: VNode[]
}

export const ElImage:IImage
/** Image Component */
export declare class ElImage extends ElementUIComponent {
interface IImage extends ElementUIComponent {
/** Image source */
src: string

Expand Down
3 changes: 2 additions & 1 deletion types/menu-item-group.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElMenuItemGroup:IMenuItemGroup
/** Menu Item Group Component */
export declare class ElMenuItemGroup extends ElementUIComponent {
interface IMenuItemGroup extends ElementUIComponent {
/** Group title */
title: string
}
3 changes: 2 additions & 1 deletion types/menu-item.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElMenuItem:IMenuItem
/** Menu Item Component */
export declare class ElMenuItem extends ElementUIComponent {
interface IMenuItem extends ElementUIComponent {
/** Unique identification */
index: string

Expand Down
3 changes: 2 additions & 1 deletion types/option-group.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElOptionGroup:IOptionGroup
/** Dropdown Select Option Group Component */
export declare class ElOptionGroup extends ElementUIComponent {
interface IOptionGroup extends ElementUIComponent {
/** Name of the group */
label: string

Expand Down
3 changes: 2 additions & 1 deletion types/option.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElOption:IOption
/** Dropdown Select Option Component */
export declare class ElOption extends ElementUIComponent {
interface IOption extends ElementUIComponent {
/** Value of option */
value: any

Expand Down
3 changes: 2 additions & 1 deletion types/page-header.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElPageHeader:IPageHeader
/** PageHeader Component */
export declare class ElPageHeader extends ElementUIComponent {
interface IPageHeader extends ElementUIComponent {
/** title */
title: String

Expand Down
3 changes: 2 additions & 1 deletion types/popconfirm.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ElementUIComponent } from './component'
import { ElPopover } from './popover'

export const ElPopconfirm:IPopconfirm
/** Popconfirm Component */
export declare class ElPopconfirm extends ElPopover {
interface IPopconfirm extends ElPopover {
/** Popconfirm title */
title: string

Expand Down
3 changes: 2 additions & 1 deletion types/popover.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export interface ElPopoverDirective extends VNodeDirective {
arg: string
}

export const ElPopover:IPopover
/** Popover Component */
export declare class ElPopover extends ElementUIComponent {
interface IPopover extends ElementUIComponent {
/** How the popover is triggered */
trigger: PopoverTrigger

Expand Down
3 changes: 2 additions & 1 deletion types/step.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export interface StepRenderSlots {
[key: string]: VNode[]
}

export const ElStep:IStep
/** Step Component */
export declare class ElStep extends ElementUIComponent {
interface IStep extends ElementUIComponent {
/** Step title */
title: string

Expand Down
3 changes: 2 additions & 1 deletion types/submenu.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElSubmenu:ISubmenu
/** Submenu Component */
export declare class ElSubmenu extends ElementUIComponent {
interface ISubmenu extends ElementUIComponent {
/** Unique identification */
index: string | null

Expand Down
3 changes: 2 additions & 1 deletion types/tab-pane.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ElementUIComponent } from './component'

export const ElTabPane:ITabPane
/** Tab Pane Component */
export declare class ElTabPane extends ElementUIComponent {
interface ITabPane extends ElementUIComponent {
/** Title of the tab */
label: string

Expand Down
3 changes: 2 additions & 1 deletion types/table-column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export interface TableColumnFilter {
value: any
}

export const ElTableColumn:ITableColumn
/** TableColumn Component */
export declare class ElTableColumn extends ElementUIComponent {
interface ITableColumn extends ElementUIComponent {
/** Type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon. */
type: TableColumnType

Expand Down
3 changes: 2 additions & 1 deletion types/table.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export interface treeNode {
loaded: boolean
}

export const ElTable:ITable
/** Table Component */
export declare class ElTable extends ElementUIComponent {
interface ITable extends ElementUIComponent {
/** Table data */
data: object[]

Expand Down
3 changes: 2 additions & 1 deletion types/time-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export interface TimePickerOptions {
format?: string
}

export const ElTimePicker:ITimePicker
/** TimePicker Component */
export declare class ElTimePicker extends ElementUIComponent {
interface ITimePicker extends ElementUIComponent {
/** Whether DatePicker is read only */
readonly: boolean

Expand Down
3 changes: 2 additions & 1 deletion types/time-select.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export interface TimeSelectOptions {
maxTime?: string
}

export const ElTimeSelect:ITimeSelect
/** TimeSelect Component */
export declare class ElTimeSelect extends ElementUIComponent {
interface ITimeSelect extends ElementUIComponent {
/** Whether DatePicker is read only */
readonly: boolean

Expand Down
Loading

0 comments on commit 469433b

Please sign in to comment.