-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add typescript bindings (#159)
- Loading branch information
1 parent
e82c42b
commit 1b39aaf
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Vue, { DirectiveOptions, PluginObject } from "vue" | ||
|
||
type ElementDescriptor = Element | string | ||
|
||
export interface ScrollOptions { | ||
container?: ElementDescriptor | ||
duration?: number | ||
easing?: string | ||
offset?: number | ||
force?: boolean | ||
cancelable?: boolean | ||
onStart?: false | ((element: Element) => any) | ||
onDone?: false | ((element: Element) => any) | ||
onCancel?: false | ((event: Event, element: Element) => any) | ||
x?: boolean | ||
y?: boolean | ||
} | ||
|
||
type ScrollToFunction = ( | ||
element: ElementDescriptor, | ||
duration?: number, | ||
options?: ScrollOptions, | ||
) => () => void | ||
|
||
declare const _default: PluginObject<ScrollOptions> & | ||
DirectiveOptions & { | ||
scrollTo: ScrollToFunction | ||
} | ||
|
||
export default _default | ||
|
||
declare module "vue/types/vue" { | ||
interface Vue { | ||
$scrollTo: ScrollToFunction | ||
} | ||
} |