File tree 2 files changed +52
-0
lines changed
2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 3
3
"version" : " 2.2.3" ,
4
4
"description" : " An infinite scroll plugin for Vue.js" ,
5
5
"main" : " dist/vue-infinite-loading.js" ,
6
+ "typings" : " types/index.d.ts" ,
6
7
"files" : [
7
8
" dist/vue-infinite-loading.js" ,
9
+ " types/*.d.ts" ,
8
10
" src"
9
11
],
10
12
"author" : {
Original file line number Diff line number Diff line change
1
+ // Type definitions for vue-infinite-loading v2.3.0
2
+ // Project: https://github.com/PeachScript/vue-infinite-loading
3
+ // Definitions by: Phil Scott <https://github.com/enkafan>
4
+ // PeachScript <https://github.com/PeachScript>
5
+
6
+ import Vue , { VNode } from 'vue' ;
7
+
8
+ declare namespace InfiniteLoading {
9
+ type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots' ;
10
+
11
+ type DirectionType = 'top' | 'bottom' ;
12
+
13
+ interface Slots {
14
+ spinner : VNode [ ] ;
15
+ 'no-result' : VNode [ ] ;
16
+ 'no-more' : VNode [ ] ;
17
+ [ key : string ] : VNode [ ] ;
18
+ }
19
+
20
+ interface StateChanger {
21
+ loaded ( ) : void ;
22
+ complete ( ) : void ;
23
+ reset ( ) : void ;
24
+ }
25
+ }
26
+
27
+ declare class InfiniteLoading extends Vue {
28
+ // The trigger distance
29
+ distance : number ;
30
+
31
+ // The load spinner type
32
+ spinner : InfiniteLoading . SpinnerType ;
33
+
34
+ // The scroll direction
35
+ direction : InfiniteLoading . DirectionType ;
36
+
37
+ // Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper
38
+ forceUseInfiniteWrapper : boolean ;
39
+
40
+ // Infinite event handler
41
+ onInfinite : ( $state : InfiniteLoading . StateChanger ) => void ;
42
+
43
+ // The method collection used to change infinite state
44
+ stateChanger : InfiniteLoading . StateChanger ;
45
+
46
+ // Slots
47
+ $slots : InfiniteLoading . Slots ;
48
+ }
49
+
50
+ export = InfiniteLoading ;
You can’t perform that action at this time.
0 commit comments