-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
vue-scrollto.d.ts
39 lines (33 loc) · 1.12 KB
/
vue-scrollto.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {DirectiveOptions, PluginObject} from "vue"
type ElementDescriptor = Element | string
export interface ScrollOptions {
el?: ElementDescriptor;
element?: ElementDescriptor;
container?: ElementDescriptor;
duration?: number;
easing?: string | [number, number, number, number];
offset?: number | ((element: ElementDescriptor, container: ElementDescriptor) => number);
force?: boolean;
cancelable?: boolean;
onStart?: ((element: Element) => any) | false;
onDone?: ((element: Element) => any) | false;
onCancel?: ((event: Event, element: Element) => any) | false;
x?: boolean;
y?: boolean;
}
type ScrollToFunction = {
(options: ScrollOptions): () => void;
(element: ElementDescriptor, options?: ScrollOptions): () => void;
(element: ElementDescriptor, duration: number, options?: ScrollOptions): () => void;
}
declare const _default: PluginObject<ScrollOptions> &
DirectiveOptions & {
scrollTo: ScrollToFunction
setDefaults: ScrollToFunction;
};
export default _default
declare module "vue/types/vue" {
interface Vue {
$scrollTo: ScrollToFunction
}
}