types(Uploader): add closeImagePreview method type

This commit is contained in:
陈嘉涵 2019-12-22 17:25:47 +08:00 committed by neverland
parent 3c526ec1a2
commit cf191e09cb
9 changed files with 17 additions and 5 deletions

View File

@ -1,5 +1,4 @@
es
lib
dist
types
node_modules

View File

@ -212,6 +212,7 @@ export default createComponent({
});
},
// @exposed-api
closeImagePreview() {
if (this.imagePreview) {
this.imagePreview.close();

View File

@ -2,6 +2,8 @@ import { VanComponent } from './component';
export class CountDown extends VanComponent {
start(): void;
pause(): void;
reset(): void;
}

1
types/field.d.ts vendored
View File

@ -2,5 +2,6 @@ import { VanComponent } from './component';
export class Field extends VanComponent {
focus(): void;
blur(): void;
}

6
types/index.d.ts vendored
View File

@ -1,3 +1,4 @@
/* eslint-disable max-classes-per-file */
import Vue from 'vue';
import { VanComponent } from './component';
import { AddressEdit } from './address-edit';
@ -17,6 +18,7 @@ import { Swipe } from './swipe';
import { SwipeCell } from './swipe-cell';
import { Tabs } from './tabs';
import { Toast } from './toast';
import { Uploader } from './uploader';
export const version: string;
export function install(vue: typeof Vue): void;
@ -84,7 +86,6 @@ export class Tabbar extends VanComponent {}
export class TabbarItem extends VanComponent {}
export class Tag extends VanComponent {}
export class TreeSelect extends VanComponent {}
export class Uploader extends VanComponent {}
export {
AddressEdit,
@ -103,5 +104,6 @@ export {
Swipe,
SwipeCell,
Tabs,
Toast
Toast,
Uploader
};

4
types/notify.d.ts vendored
View File

@ -13,7 +13,7 @@ export type NotifyOptions = {
onClose?: (() => void) | null;
onOpened?: (() => void) | null;
onClick?: ((event: Event) => void) | null;
}
};
export interface VanNotify extends Vue {
message: NotifyMessage;
@ -34,7 +34,7 @@ export interface Notify {
declare module 'vue/types/vue' {
interface Vue {
$notify: Notify
$notify: Notify;
}
}

View File

@ -2,5 +2,6 @@ import { VanComponent } from './component';
export class SwipeCell extends VanComponent {
open(position: 'left' | 'right'): void;
close(): void;
}

1
types/swipe.d.ts vendored
View File

@ -6,5 +6,6 @@ export type SwipeToOptions = {
export class Swipe extends VanComponent {
swipeTo(index: number, options?: SwipeToOptions): void;
resize(): void;
}

5
types/uploader.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import { VanComponent } from './component';
export class Uploader extends VanComponent {
closeImagePreview(): void;
}