33// Definitions by: Phil Scott <https://github.com/enkafan>
44// PeachScript <https://github.com/PeachScript>
55
6- import Vue , { VNode } from 'vue' ;
6+ import Vue , { VNode , Component } from 'vue' ;
77
88export type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots' ;
99export type DirectionType = 'top' | 'bottom' ;
@@ -12,13 +12,35 @@ export interface Slots {
1212 spinner : VNode [ ] ;
1313 'no-result' : VNode [ ] ;
1414 'no-more' : VNode [ ] ;
15+ 'error' : VNode [ ] ;
1516 [ key : string ] : VNode [ ] ;
1617}
1718
1819export interface StateChanger {
1920 loaded ( ) : void ;
2021 complete ( ) : void ;
2122 reset ( ) : void ;
23+ error ( ) : void ;
24+ }
25+
26+ export interface InfiniteOptions {
27+ props ?: {
28+ spinner ?: SpinnerType ;
29+ distance ?: number ;
30+ forceUseInfiniteWrapper ?: boolean | string ;
31+ } ;
32+
33+ system ?: {
34+ throttleLimit ?: number ;
35+ } ;
36+
37+ slots ?: {
38+ noResults ?: string | Component ;
39+ noMore ?: string | Component ;
40+ error ?: string | Component ;
41+ errorBtnText ?: string ;
42+ spinner ?: string | Component ;
43+ } ;
2244}
2345
2446export default class InfiniteLoading extends Vue {
@@ -32,7 +54,7 @@ export default class InfiniteLoading extends Vue {
3254 direction : DirectionType ;
3355
3456 // Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper
35- forceUseInfiniteWrapper : boolean ;
57+ forceUseInfiniteWrapper : boolean | string ;
3658
3759 // Infinite event handler
3860 onInfinite : ( $state : StateChanger ) => void ;
0 commit comments