Skip to content

Commit

Permalink
fix(object): add TS aliases
Browse files Browse the repository at this point in the history
fix(object): remove dead code

fix(object): fix TS libdef
  • Loading branch information
bigslycat committed Mar 3, 2019
1 parent 1e395ff commit 3cab409
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,16 @@ export declare var objOf: typeof objectOf;
export declare var isObjOf: typeof objectOf;
export declare var passObjOf: typeof objectOf;

type ExtractReturnTypeObject = <T>(
fn: (valueName: string, value: unknown) => ValidationError | T
) => T;

export declare function object<
S extends {
[prop: string]: (valueName: string, value: unknown) => any,
},
>(spec: S): Contract<{
readonly [K in keyof S]: Exclude<ReturnType<S[K]>, ValidationError>
}>;

export declare var isObject: typeof object;
export declare var passObject: typeof object;
export declare var obj: typeof object;
export declare var isObj: typeof object;
export declare var passObj: typeof object;

0 comments on commit 3cab409

Please sign in to comment.