Skip to content

Commit

Permalink
Add TypeScript definitions
Browse files Browse the repository at this point in the history
Thanks to soerenbf for initial version
  • Loading branch information
trevorr committed Sep 16, 2019
1 parent 8b9e005 commit de313da
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"description": "Scroll position manager for React applications",
"main": "lib/index.js",
"files": [
"lib"
"lib",
"src/index.d.ts"
],
"types": "src/index.d.ts",
"scripts": {
"build": "babel src --out-dir lib",
"lint": "eslint 'src/*.js' 'test/*.js'",
Expand Down
18 changes: 18 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import { History } from 'history';

export interface ScrollManagerProps {
history: History;
sessionKey?: string;
timeout?: number;
}

export class ScrollManager extends React.Component<ScrollManagerProps> { }

export class WindowScroller extends React.Component { }

export interface ElementScrollerProps {
scrollKey: string;
}

export class ElementScroller extends React.Component<ElementScrollerProps> { }

0 comments on commit de313da

Please sign in to comment.