From 677ca9aa2856d426755c1846cadd9b5da3a876a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Vince?= Date: Fri, 27 Oct 2017 13:10:41 +0200 Subject: [PATCH 1/3] vue-scroll accepts elements too not just string for container and elements --- types/vue-scrollto/index.d.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/types/vue-scrollto/index.d.ts b/types/vue-scrollto/index.d.ts index 5ca330d646..c9e056b261 100644 --- a/types/vue-scrollto/index.d.ts +++ b/types/vue-scrollto/index.d.ts @@ -9,10 +9,10 @@ import { PluginFunction } from "vue"; declare namespace VueScrollTo { interface Options { // The element you want to scroll to. - el?: string; - element?: string; + el?: string | Element; + element?: string | Element; // The container that has to be scrolled. Default: body - container?: string; + container?: string | Element; // The duration (in milliseconds) of the scrolling animation. Default: 500 duration?: number; // The easing to be used when animating. Default: ease @@ -31,17 +31,25 @@ declare namespace VueScrollTo { // Whether or not we want scrolling on the y axis. Default: true y?: boolean; } + + interface VueStatic { + (options: VueScrollTo.Options): void; + + (element: string | Element, options?: VueScrollTo.Options): void; + + (element: string | Element, duration: number, options?: VueScrollTo.Options): void; + } } declare class VueScrollTo { static install: PluginFunction; - scrollTo(element: string | HTMLElement, options?: VueScrollTo.Options): void; + scrollTo: VueScrollTo.VueStatic; } -declare module "vue/types/vue" { +declare module 'vue/types/vue' { interface Vue { - $scrollTo: typeof VueScrollTo.prototype.scrollTo; + $scrollTo: VueScrollTo.VueStatic; } } From 088e63ab57e84f4eb505ff7ad9616829104681a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Vince?= Date: Fri, 27 Oct 2017 14:28:16 +0200 Subject: [PATCH 2/3] Remove qualifier is unnecessary since 'VueScrollTo' is in scope. --- types/vue-scrollto/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/vue-scrollto/index.d.ts b/types/vue-scrollto/index.d.ts index c9e056b261..d3a7ec7efb 100644 --- a/types/vue-scrollto/index.d.ts +++ b/types/vue-scrollto/index.d.ts @@ -33,11 +33,11 @@ declare namespace VueScrollTo { } interface VueStatic { - (options: VueScrollTo.Options): void; + (options: Options): void; - (element: string | Element, options?: VueScrollTo.Options): void; + (element: string | Element, options?: Options): void; - (element: string | Element, duration: number, options?: VueScrollTo.Options): void; + (element: string | Element, duration: number, options?: Options): void; } } From 175347f17b064b99d21dd55a2f55e456c6ef3252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Vince?= Date: Mon, 30 Oct 2017 08:50:03 +0100 Subject: [PATCH 3/3] Remove white space between coresponding methods --- types/vue-scrollto/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/vue-scrollto/index.d.ts b/types/vue-scrollto/index.d.ts index d3a7ec7efb..47371283d9 100644 --- a/types/vue-scrollto/index.d.ts +++ b/types/vue-scrollto/index.d.ts @@ -34,9 +34,7 @@ declare namespace VueScrollTo { interface VueStatic { (options: Options): void; - (element: string | Element, options?: Options): void; - (element: string | Element, duration: number, options?: Options): void; } }