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 es
lib lib
dist dist
types
node_modules node_modules

View File

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

View File

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

1
types/field.d.ts vendored
View File

@ -2,5 +2,6 @@ import { VanComponent } from './component';
export class Field extends VanComponent { export class Field extends VanComponent {
focus(): void; focus(): void;
blur(): 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 Vue from 'vue';
import { VanComponent } from './component'; import { VanComponent } from './component';
import { AddressEdit } from './address-edit'; import { AddressEdit } from './address-edit';
@ -17,6 +18,7 @@ import { Swipe } from './swipe';
import { SwipeCell } from './swipe-cell'; import { SwipeCell } from './swipe-cell';
import { Tabs } from './tabs'; import { Tabs } from './tabs';
import { Toast } from './toast'; import { Toast } from './toast';
import { Uploader } from './uploader';
export const version: string; export const version: string;
export function install(vue: typeof Vue): void; export function install(vue: typeof Vue): void;
@ -84,7 +86,6 @@ export class Tabbar extends VanComponent {}
export class TabbarItem extends VanComponent {} export class TabbarItem extends VanComponent {}
export class Tag extends VanComponent {} export class Tag extends VanComponent {}
export class TreeSelect extends VanComponent {} export class TreeSelect extends VanComponent {}
export class Uploader extends VanComponent {}
export { export {
AddressEdit, AddressEdit,
@ -103,5 +104,6 @@ export {
Swipe, Swipe,
SwipeCell, SwipeCell,
Tabs, Tabs,
Toast Toast,
Uploader
}; };

4
types/notify.d.ts vendored
View File

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

View File

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

1
types/swipe.d.ts vendored
View File

@ -6,5 +6,6 @@ export type SwipeToOptions = {
export class Swipe extends VanComponent { export class Swipe extends VanComponent {
swipeTo(index: number, options?: SwipeToOptions): void; swipeTo(index: number, options?: SwipeToOptions): void;
resize(): 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;
}