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