diff --git a/types/index.d.ts b/types/index.d.ts index 9a3fd40..df9f227 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -2,20 +2,13 @@ // Project: https://github.com/PeachScript/vue-infinite-loading // Definitions by: Phil Scott // PeachScript +// Andrew Vasilchuk import Vue, { VNode, Component, PluginFunction } from 'vue'; export type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots'; export type DirectionType = 'top' | 'bottom'; -export interface Slots { - spinner: VNode[]; - 'no-result': VNode[]; - 'no-more': VNode[]; - 'error': VNode[]; - [key: string]: VNode[]; -} - export interface StateChanger { loaded(): void; complete(): void; @@ -23,7 +16,7 @@ export interface StateChanger { error(): void; } -export interface InfiniteOptions { +export interface PluginOptions { props?: { spinner?: SpinnerType; distance?: number; @@ -43,28 +36,7 @@ export interface InfiniteOptions { }; } -export default class InfiniteLoading extends Vue { - // The trigger distance - distance: number; - - // The load spinner type - spinner: SpinnerType; - - // The scroll direction - direction: DirectionType; - - // Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper - forceUseInfiniteWrapper: boolean | string; - - // Infinite event handler - onInfinite: ($state: StateChanger) => void; - - // The method collection used to change infinite state - stateChanger: StateChanger; - - // Slots - $slots: Slots; - - static install: PluginFunction; +declare class VueInfiniteLoading { + static install: PluginFunction }