mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #8391 from oizie/react-scroll
Added new react scroll type definitions and tests
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="./react-scroll.d.ts" />
|
||||
|
||||
import * as React from 'react';
|
||||
import { Link, Element, scroller } from 'react-scroll';
|
||||
|
||||
let link = <Link to="test" />;
|
||||
let element = <Element name="test" />;
|
||||
|
||||
scroller.scrollTo("test");
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for redux-immutable v3.0.5
|
||||
// Project: https://github.com/fisshy/react-scroll
|
||||
// Definitions by: Pedro Pereira <https://github.com/oizie>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
declare module "react-scroll" {
|
||||
import React = __React
|
||||
|
||||
interface Link extends React.ClassicComponentClass<any> {}
|
||||
interface Element extends React.ClassicComponentClass<any> {}
|
||||
|
||||
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) : void
|
||||
}
|
||||
|
||||
const Link: Link;
|
||||
const Element: Element;
|
||||
const Events: Events;
|
||||
const scroller: scroller;
|
||||
|
||||
export {
|
||||
Link,
|
||||
Element,
|
||||
Events,
|
||||
scroller
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user