Skip to content

Commit 518a16a

Browse files
snowyuPeachScript
authored andcommitted
fix: export bug in TypeScript definition (#188)
1 parent 42015bb commit 518a16a

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

types/index.d.ts

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,42 @@
55

66
import Vue, { VNode } from 'vue';
77

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-
}
8+
export type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots';
9+
export type DirectionType = 'top' | 'bottom';
10+
11+
export interface Slots {
12+
spinner: VNode[];
13+
'no-result': VNode[];
14+
'no-more': VNode[];
15+
[key: string]: VNode[];
2516
}
2617

27-
declare class InfiniteLoading extends Vue {
18+
export interface StateChanger {
19+
loaded(): void;
20+
complete(): void;
21+
reset(): void;
22+
}
23+
24+
export default class InfiniteLoading extends Vue {
2825
// The trigger distance
2926
distance: number;
3027

3128
// The load spinner type
32-
spinner: InfiniteLoading.SpinnerType;
29+
spinner: SpinnerType;
3330

3431
// The scroll direction
35-
direction: InfiniteLoading.DirectionType;
32+
direction: DirectionType;
3633

3734
// Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper
3835
forceUseInfiniteWrapper: boolean;
3936

4037
// Infinite event handler
41-
onInfinite: ($state: InfiniteLoading.StateChanger) => void;
38+
onInfinite: ($state: StateChanger) => void;
4239

4340
// The method collection used to change infinite state
44-
stateChanger: InfiniteLoading.StateChanger;
41+
stateChanger: StateChanger;
4542

4643
// Slots
47-
$slots: InfiniteLoading.Slots;
44+
$slots: Slots;
4845
}
4946

50-
export default InfiniteLoading;

0 commit comments

Comments
 (0)