Skip to content

Commit

Permalink
build files
Browse files Browse the repository at this point in the history
  • Loading branch information
allansson committed Aug 16, 2024
1 parent 8cd5eba commit f01e1f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/check.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type FalsyCheckValue = Array<unknown> | Record<string | number | symbol, unknown> | boolean | string | number | null | undefined;
type Checker<T> = ((value: T) => FalsyCheckValue) | ((value: T) => Promise<FalsyCheckValue>) | FalsyCheckValue | Promise<FalsyCheckValue>;
type CheckValue = Array<unknown> | Record<string | number | symbol, unknown> | boolean | string | number | null | undefined;
type Checker<T> = ((value: T) => CheckValue) | ((value: T) => Promise<CheckValue>) | CheckValue | Promise<CheckValue>;
interface CheckMap<T> {
[key: string]: Checker<T>;
}
interface SyncCheckMap {
[key: string]: ((value: any) => FalsyCheckValue) | FalsyCheckValue;
[key: string]: ((value: any) => CheckValue) | CheckValue;
}
type CheckResult<C extends CheckMap<any>> = C extends SyncCheckMap ? boolean : Promise<boolean>;
export declare function check<T, C extends CheckMap<T>>(value: T, checkers: C, tags?: Record<string, string>): CheckResult<C>;
Expand Down

0 comments on commit f01e1f0

Please sign in to comment.