Skip to content

Commit

Permalink
Replace interface extensions with intersection types
Browse files Browse the repository at this point in the history
  • Loading branch information
aikoven committed Apr 7, 2017
1 parent 30bf21a commit 56c1856
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
export as namespace Reselect;

export interface Selector<S, R> {
(state: S): R;
}
export interface OutputSelector<S, R, C> extends Selector<S, R> {
export type Selector<S, R> = (state: S) => R;

export type OutputSelector<S, R, C> = Selector<S, R> & {
resultFunc: C;
recomputations: () => number;
resetRecomputations: () => number;
}

export interface ParametricSelector<S, P, R> {
(state: S, props: P, ...args: any[]): R;
}
export interface OutputParametricSelector<S, P, R, C> extends ParametricSelector<S, P, R> {
export type ParametricSelector<S, P, R> = (state: S, props: P, ...args: any[]) => R;

export type OutputParametricSelector<S, P, R, C> = ParametricSelector<S, P, R> & {
resultFunc: C;
recomputations: () => number;
resetRecomputations: () => number;
Expand Down

0 comments on commit 56c1856

Please sign in to comment.