Skip to content

Commit

Permalink
Merge pull request #25 from janslow/feature/typescript-definitions
Browse files Browse the repository at this point in the history
Add TypeScript definitions
  • Loading branch information
mironov committed Jan 15, 2017
2 parents cfa1c93 + b9e96b6 commit dec5416
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Component, CSSProperties } from 'react';
import { Middleware, Reducer, Action } from 'redux';

export interface LoadingBarContainerProps {
style?: CSSProperties;
className?: string;
actions?: Object;
updateTime?: number;
maxProgress?: number;
progressIncrease?: number;
}
export default class LoadingBarContainer extends Component<LoadingBarContainerProps, {}> {}

export interface LoadingBarProps extends LoadingBarContainerProps {
loading?: number;
}
export class LoadingBar extends Component<LoadingBarProps, {}> {}
export class ImmutableLoadingBar extends Component<LoadingBarContainerProps, {}> {}

export interface MiddlewareConfig {
promiseTypeSuffixes?: string[];
}
export function loadingBarMiddleware(config?: MiddlewareConfig): Middleware;

export const loadingBarReducer: Reducer<any>;
export function showLoading(): Action;
export function hideLoading(): Action;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.6.1",
"description": "Simple Loading Bar for Redux and React",
"main": "build/index.js",
"typings": "index.d.ts",
"scripts": {
"build": "`npm bin`/babel src -d build",
"build:watch": "npm run build -- --watch",
Expand Down Expand Up @@ -33,12 +34,14 @@
},
"homepage": "https://github.com/mironov/react-redux-loading-bar",
"peerDependencies": {
"@types/react": ">=0.14.55",
"react": "^0.14.0 || ^15.0.0",
"react-dom": "^0.14.0 || ^15.0.0",
"react-redux": "^3.0.0 || ^4.0.0 || ^5.0.0",
"redux": "^3.0.0"
},
"devDependencies": {
"@types/react": "^0.14.55",
"babel-cli": "^6.7.7",
"babel-core": "^6.7.7",
"babel-eslint": "^7.1.1",
Expand Down

0 comments on commit dec5416

Please sign in to comment.