diff --git a/types/index.d.ts b/types/index.d.ts index 9faba7a50..31fceb0fb 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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 }; diff --git a/types/swipe.d.ts b/types/swipe.d.ts new file mode 100644 index 000000000..93c9523b5 --- /dev/null +++ b/types/swipe.d.ts @@ -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; +}