types(Swipe): add swipeTo、resize method types

This commit is contained in:
陈嘉涵 2019-12-22 17:18:04 +08:00 committed by neverland
parent 9a9676d6af
commit a1831b8638
2 changed files with 13 additions and 1 deletions

4
types/index.d.ts vendored
View File

@ -13,11 +13,13 @@ import { Lazyload } from './lazyload';
import { List } from './list';
import { Locale } from './locale';
import { Notify } from './notify';
import { Swipe } from './swipe';
import { SwipeCell } from './swipe-cell';
import { Toast } from './toast';
export const version: string;
export function install(vue: typeof Vue): void;
export class ActionSheet extends VanComponent {}
export class AddressList extends VanComponent {}
export class Button extends VanComponent {}
@ -73,7 +75,6 @@ export class Stepper extends VanComponent {}
export class Steps extends VanComponent {}
export class Sticky extends VanComponent {}
export class SubmitBar extends VanComponent {}
export class Swipe extends VanComponent {}
export class SwipeItem extends VanComponent {}
export class Switch extends VanComponent {}
export class SwitchCell extends VanComponent {}
@ -99,6 +100,7 @@ export {
List,
Locale,
Notify,
Swipe,
SwipeCell,
Toast
};

10
types/swipe.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
import { VanComponent } from './component';
export type SwipeToOptions = {
immediate?: boolean;
};
export class Swipe extends VanComponent {
swipeTo(index: number, options?: SwipeToOptions): void;
resize(): void;
}