12 lines
370 B
TypeScript
12 lines
370 B
TypeScript
import { Result } from "../result";
|
|
import { Type } from "../type";
|
|
type Guard<T> = (val: any) => val is T;
|
|
export declare class Is<T> extends Type<T> {
|
|
readonly name: string;
|
|
readonly isT: Guard<T>;
|
|
constructor(name: string, guard: Guard<T>);
|
|
check(val: any): Result<T>;
|
|
}
|
|
export declare function is<T>(name: string, guard: Guard<T>): Is<T>;
|
|
export {};
|