Skip to content

Commit

Permalink
Fix store validate function type
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban committed May 4, 2021
1 parent 312f634 commit 0058a37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ declare namespace hybrids {
function resolve<M>(model: M): Promise<M>;
function ref<M>(fn: () => M): M;

interface ValidateFunction<M> {
(value: string | number, key: string, model: M): string | boolean | void;
interface ValidateFunction<M, T> {
(value: T, key: string, model: M): string | boolean | void;
}

function value<M>(
defaultValue: string,
validate?: ValidateFunction<M> | RegExp,
validate?: ValidateFunction<M, string> | RegExp,
errorMessage?: string,
): string;
function value<M>(
defaultValue: number,
validate?: ValidateFunction<M> | RegExp,
validate?: ValidateFunction<M, number> | RegExp,
errorMessage?: string,
): number;
}
Expand Down

0 comments on commit 0058a37

Please sign in to comment.