Skip to content

Commit

Permalink
fix: Fix typing for withProps (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
taion authored Nov 22, 2019
1 parent ea0c1fc commit 1ee0de1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions types/helpers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import * as React from 'react';

export type Omit<T, U> = Pick<T, Exclude<keyof T, U>>;

export type mapper<TInner, TOuter> = (input: TInner) => TOuter;

export interface InferableComponentEnhancerWithProps<
TInjectedProps,
TNeedsProps
Expand All @@ -16,9 +14,9 @@ export interface InferableComponentEnhancerWithProps<
}

export function mapProps<TInner, TOuter>(
propsMapper: mapper<TOuter, TInner>,
mapper: (input: TOuter) => TInner,
): InferableComponentEnhancerWithProps<TInner, TOuter>;

export function withProps<TInner, TOuter>(
createProps: TInner | mapper<TOuter, TInner>,
objOrMapper: Partial<TInner> | ((input: TOuter) => Partial<TInner>),
): InferableComponentEnhancerWithProps<TInner & TOuter, TOuter>;

0 comments on commit 1ee0de1

Please sign in to comment.