Skip to content

Commit dc23fd6

Browse files
committed
feat(shape): add TS support
1 parent 3cab409 commit dc23fd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,11 @@ export declare var passObject: typeof object;
149149
export declare var obj: typeof object;
150150
export declare var isObj: typeof object;
151151
export declare var passObj: typeof object;
152+
153+
export declare function shape<
154+
S extends {
155+
[prop: string]: (valueName: string, value: unknown) => any,
156+
},
157+
>(spec: S): Contract<{
158+
readonly [K in keyof S]: void | Exclude<ReturnType<S[K]>, ValidationError>
159+
}>;

0 commit comments

Comments
 (0)