Skip to content

Commit 0ac1643

Browse files
committed
fix: add missing types for plugin options and error slot
1 parent 19dcc0f commit 0ac1643

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

types/index.d.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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

88
export type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots';
99
export 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

1819
export 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

2446
export 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

Comments
 (0)