diff --git a/types/index.d.ts b/types/index.d.ts index 729148e..1491b25 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -3,25 +3,28 @@ // Definitions by: Phil Scott // PeachScript -import Vue, { VNode } from 'vue'; - -declare namespace InfiniteLoading { - type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots'; - - type DirectionType = 'top' | 'bottom'; - - interface Slots { - spinner: VNode[]; - 'no-result': VNode[]; - 'no-more': VNode[]; - [key: string]: VNode[]; - } +import Vue, { VNode } 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[]; + [key: string]: VNode[]; +} - interface StateChanger { - loaded(): void; - complete(): void; - reset(): void; - } +export interface StateChanger { + loaded(): void; + complete(): void; + reset(): void; } declare class InfiniteLoading extends Vue { @@ -29,22 +32,22 @@ declare class InfiniteLoading extends Vue { distance: number; // The load spinner type - spinner: InfiniteLoading.SpinnerType; + spinner: SpinnerType; // The scroll direction - direction: InfiniteLoading.DirectionType; + direction: DirectionType; // Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper forceUseInfiniteWrapper: boolean; // Infinite event handler - onInfinite: ($state: InfiniteLoading.StateChanger) => void; + onInfinite: ($state: StateChanger) => void; // The method collection used to change infinite state - stateChanger: InfiniteLoading.StateChanger; + stateChanger: StateChanger; // Slots - $slots: InfiniteLoading.Slots; + $slots: Slots; } export default InfiniteLoading;