From f178a4337634ca1783ef1daaf40a6523c3837285 Mon Sep 17 00:00:00 2001 From: oizie Date: Fri, 4 Mar 2016 16:26:46 +0000 Subject: [PATCH 01/16] added new react scroll type definitions and tests --- react-scroll/react-scroll-tests.ts | 26 +++++++++++++++++++++ react-scroll/react-scroll.d.ts | 36 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 react-scroll/react-scroll-tests.ts create mode 100644 react-scroll/react-scroll.d.ts diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts new file mode 100644 index 000000000..e6d728ceb --- /dev/null +++ b/react-scroll/react-scroll-tests.ts @@ -0,0 +1,26 @@ +/// + +import { Link, Element, Events, scroller } from 'react-scroll'; + +class LinkTest extends React.Component, {}> { + + render() { + return
+ +
+ } + +} + +class ElementTest extends React.Component, {}> { + + render() { + return
+ +
+ } +} + +scroller.scrollTo("test"); + + diff --git a/react-scroll/react-scroll.d.ts b/react-scroll/react-scroll.d.ts new file mode 100644 index 000000000..79bb1421c --- /dev/null +++ b/react-scroll/react-scroll.d.ts @@ -0,0 +1,36 @@ +// Type definitions for redux-immutable v3.0.5 +// Project: https://github.com/fisshy/react-scroll +// Definitions by: Pedro Pereira +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "react-scroll" { + import React = __React + + interface Link extends React.ClassicComponentClass {} + interface Element extends React.ClassicComponentClass {} + + interface scrollEvnt { + register(evtName: string, callback: Function) : void, + remove(evtName: string) : void + } + + interface Events { + scrollEvent: scrollEvnt + } + + interface scroller { + scrollTo(to: any, animate?: any, duration?: any, offset?: any) + } + + const Link: Link; + const Element: Element; + const Events: Events; + const scroller: scroller; + + export { + Link, + Element, + Events, + scroller + } +} \ No newline at end of file From 5ec4f0fd494c2d954799240cc78805b8109a7b4d Mon Sep 17 00:00:00 2001 From: oizie Date: Wed, 9 Mar 2016 17:28:17 +0000 Subject: [PATCH 02/16] Fixed test --- react-scroll/react-scroll-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index e6d728ceb..4e6b139d4 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,5 +1,7 @@ /// +/// +import * as React from 'react'; import { Link, Element, Events, scroller } from 'react-scroll'; class LinkTest extends React.Component, {}> { From a9f2dc3bc81b9b2bb50a925d5855582b924e5572 Mon Sep 17 00:00:00 2001 From: oizie Date: Wed, 9 Mar 2016 17:36:24 +0000 Subject: [PATCH 03/16] Changed tests --- react-scroll/react-scroll-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 4e6b139d4..ecb87c9e6 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -8,7 +8,7 @@ class LinkTest extends React.Component, {}> { render() { return
- + Dashboard
} @@ -18,7 +18,7 @@ class ElementTest extends React.Component, {}> { render() { return
- + Test
} } From dec616d1ef40f2fab74ff6fae54577fb294c8a9f Mon Sep 17 00:00:00 2001 From: Pedro Inacio Date: Thu, 10 Mar 2016 09:10:36 +0000 Subject: [PATCH 04/16] Fixed tests --- react-scroll/react-scroll-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index ecb87c9e6..ef7ab170e 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,5 +1,5 @@ -/// /// +/// import * as React from 'react'; import { Link, Element, Events, scroller } from 'react-scroll'; From e2ff7ea5200dbb9daa3c07813cdd79237ee606ac Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 09:30:36 +0000 Subject: [PATCH 05/16] Added references in react-scroll typings --- react-scroll/react-scroll.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react-scroll/react-scroll.d.ts b/react-scroll/react-scroll.d.ts index 79bb1421c..7892c22f2 100644 --- a/react-scroll/react-scroll.d.ts +++ b/react-scroll/react-scroll.d.ts @@ -3,6 +3,8 @@ // Definitions by: Pedro Pereira // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module "react-scroll" { import React = __React From 84d5dcdf3f346f1821ce46c263b8af812cf9cb98 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 09:35:05 +0000 Subject: [PATCH 06/16] Added return type to the function --- react-scroll/react-scroll.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-scroll/react-scroll.d.ts b/react-scroll/react-scroll.d.ts index 7892c22f2..fbaf8d3d2 100644 --- a/react-scroll/react-scroll.d.ts +++ b/react-scroll/react-scroll.d.ts @@ -21,7 +21,7 @@ declare module "react-scroll" { } interface scroller { - scrollTo(to: any, animate?: any, duration?: any, offset?: any) + scrollTo(to: any, animate?: any, duration?: any, offset?: any) : void } const Link: Link; From 69882a252822d8a909b3436ffd10b58e9dacd9dc Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 09:40:31 +0000 Subject: [PATCH 07/16] Changed tests --- react-scroll/react-scroll-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index ef7ab170e..60fe1d1de 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -8,7 +8,7 @@ class LinkTest extends React.Component, {}> { render() { return
- Dashboard + Dashboard
} From e0a74d09ed0551e115f8bd66f3a53205c7a781ce Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 09:59:00 +0000 Subject: [PATCH 08/16] Fixed the tests. --- react-scroll/react-scroll-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 60fe1d1de..7fda415d1 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,8 +1,8 @@ /// /// -import * as React from 'react'; -import { Link, Element, Events, scroller } from 'react-scroll'; +import * as React from 'react' +import { Link, Element, Events, scroller } from 'react-scroll' class LinkTest extends React.Component, {}> { From 38eab28f31db5a3308859847f701280985db8d3d Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 10:38:41 +0000 Subject: [PATCH 09/16] Changed the tests --- react-scroll/react-scroll-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 7fda415d1..1b2dce32b 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,10 +1,10 @@ /// /// -import * as React from 'react' +import { Component } from 'react' import { Link, Element, Events, scroller } from 'react-scroll' -class LinkTest extends React.Component, {}> { +class LinkTest extends Component { render() { return
@@ -14,7 +14,7 @@ class LinkTest extends React.Component, {}> { } -class ElementTest extends React.Component, {}> { +class ElementTest extends Component { render() { return
From 1a111adc81fb9f18d5e66ae7e85c073a9ef84f28 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 10:41:41 +0000 Subject: [PATCH 10/16] Changed the tests --- react-scroll/react-scroll-tests.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 1b2dce32b..57fd60f0f 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -7,9 +7,11 @@ import { Link, Element, Events, scroller } from 'react-scroll' class LinkTest extends Component { render() { - return
+ return ( +
Dashboard
+ ); } } @@ -17,9 +19,11 @@ class LinkTest extends Component { class ElementTest extends Component { render() { - return
+ return ( +
Test
+ ); } } From 6b60e32d95f54600c2bcb3fc30c91579315a75c4 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 10:51:24 +0000 Subject: [PATCH 11/16] Changed way of testing --- react-scroll/react-scroll-tests.ts | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 57fd60f0f..4290ec5a1 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,31 +1,13 @@ /// /// +/// import { Component } from 'react' +import * as ReactDOM from 'react-dom'; import { Link, Element, Events, scroller } from 'react-scroll' -class LinkTest extends Component { - - render() { - return ( -
- Dashboard -
- ); - } - -} - -class ElementTest extends Component { - - render() { - return ( -
- Test -
- ); - } -} +let link = Dashboard; +let element = Test; scroller.scrollTo("test"); From 5ca2760d99f4963a352c6069872841174594a4d6 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 10:55:28 +0000 Subject: [PATCH 12/16] Changed way of testing --- react-scroll/react-scroll-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index 4290ec5a1..ce209608d 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -6,9 +6,9 @@ import { Component } from 'react' import * as ReactDOM from 'react-dom'; import { Link, Element, Events, scroller } from 'react-scroll' -let link = Dashboard; -let element = Test; +let link = ; +let element = ; -scroller.scrollTo("test"); +//scroller.scrollTo("test"); From 3e2f88b5e3a6ca77eabe3186845882f314d152f5 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 11:01:05 +0000 Subject: [PATCH 13/16] Removed unused references --- react-scroll/react-scroll-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index ce209608d..f8519d524 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -3,8 +3,7 @@ /// import { Component } from 'react' -import * as ReactDOM from 'react-dom'; -import { Link, Element, Events, scroller } from 'react-scroll' +import { Link, Element, scroller } from 'react-scroll' let link = ; let element = ; From 6b6e717b3aac825503fa79b4c0c4e467fd91fe70 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 11:06:44 +0000 Subject: [PATCH 14/16] Removed unused references --- react-scroll/react-scroll-tests.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.ts index f8519d524..a1d3a2890 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.ts @@ -1,6 +1,5 @@ /// /// -/// import { Component } from 'react' import { Link, Element, scroller } from 'react-scroll' @@ -8,6 +7,4 @@ import { Link, Element, scroller } from 'react-scroll' let link = ; let element = ; -//scroller.scrollTo("test"); - - +//scroller.scrollTo("test"); \ No newline at end of file From ec48a81c06cd2459d76d65716bca9961b46928b2 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 11:10:51 +0000 Subject: [PATCH 15/16] Changed to proper extension --- .../{react-scroll-tests.ts => react-scroll-tests.tsx} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename react-scroll/{react-scroll-tests.ts => react-scroll-tests.tsx} (58%) diff --git a/react-scroll/react-scroll-tests.ts b/react-scroll/react-scroll-tests.tsx similarity index 58% rename from react-scroll/react-scroll-tests.ts rename to react-scroll/react-scroll-tests.tsx index a1d3a2890..d8da82732 100644 --- a/react-scroll/react-scroll-tests.ts +++ b/react-scroll/react-scroll-tests.tsx @@ -1,10 +1,10 @@ /// /// -import { Component } from 'react' -import { Link, Element, scroller } from 'react-scroll' +import { Component } from 'react'; +import { Link, Element, scroller } from 'react-scroll'; let link = ; let element = ; -//scroller.scrollTo("test"); \ No newline at end of file +scroller.scrollTo("test"); \ No newline at end of file From e690244ecff2504acf45e56029a83665db535bd5 Mon Sep 17 00:00:00 2001 From: oizie Date: Thu, 10 Mar 2016 11:14:38 +0000 Subject: [PATCH 16/16] Added React --- react-scroll/react-scroll-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-scroll/react-scroll-tests.tsx b/react-scroll/react-scroll-tests.tsx index d8da82732..b39b9681f 100644 --- a/react-scroll/react-scroll-tests.tsx +++ b/react-scroll/react-scroll-tests.tsx @@ -1,7 +1,7 @@ /// /// -import { Component } from 'react'; +import * as React from 'react'; import { Link, Element, scroller } from 'react-scroll'; let link = ;