Skip to content

Commit

Permalink
Update typings for redux-logger to 2.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Kelley committed Feb 25, 2016
1 parent 98f53ca commit 81e4e35
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions redux-logger/redux-logger.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for redux-logger v2.0.0
// Type definitions for redux-logger v2.6.0
// Project: https://github.com/fcomb/redux-logger
// Definitions by: Alexander Rusakov <https://github.com/arusakov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
Expand All @@ -7,16 +7,33 @@

declare module 'redux-logger' {

type LoggerPredicate = (getState: () => any, action: any) => boolean;

interface ColorsObject {
title?: (action: any) => string;
prevState?: (prevState: any) => string;
action?: (action: any) => string;
nextState?: (nextState: any) => string;
error?: (error: any, prevState: any) => string;
}

interface ReduxLoggerOptions {
actionTransformer?: (action: any) => any;
collapsed?: boolean;
duration?: boolean;
level?: string;
logger?: any;
predicate?: (getState: Function, action: any) => boolean;
duration?: boolean;
timestamp?: boolean;
colors?: ColorsObject;
logger?: any;
logErrors?: boolean;
collapsed?: boolean | LoggerPredicate;
predicate?: LoggerPredicate;
stateTransformer?: (state: any) => any;
actionTransformer?: (action: any) => any;
errorTransformer?: (error: any) => any;
}

export function createLogger(options?: ReduxLoggerOptions): Redux.Middleware;
// Trickery to get TypeScript to accept that our anonymous, non-default export is a function.
// see https://github.com/Microsoft/TypeScript/issues/3612 for more
namespace createLogger {}
function createLogger(options?: ReduxLoggerOptions): Redux.Middleware;
export = createLogger;
}

0 comments on commit 81e4e35

Please sign in to comment.