export type Primitive = string | number | symbol | bigint | boolean | null | undefined; export type Dictionary = { [key: string]: unknown; }; export type MetaNever = { meta?: never; }; export type MetaObj = { meta: TMeta; }; /** @typeparam TBad - Each struct can returns some kinds of issues (not throwing) @typeparam TGood - The type which is guaranteed to be the output of the validator @typeparam TInput - The type of the input value. @example a numeric string can be based on the definition of a string. so you can base a numeric string on a string struct (if you want). By default the `unknown` struct is used. That is the only core struct */ export type Sure = ((value: TInput) => Good | Bad) & TMeta; /** Returns the exact function back. But the types are inferred automatically for you. Expects you to pass a function that gets an `unknown` value and returns either: [true, ] [false, ] Check the `sure.ts` version to check the types @example Check playground.ts to hover over variables */ export declare function sure(insure: Sure, meta: TMeta): Sure>; export declare function pure(insure: Sure): Sure; export declare function bad(val: TBad): Bad; export declare function bad(val: TBad): Bad; export declare function good(val: TGood): Good; export declare function good(val: TGood): Good; export type Unsure = // Good | Bad; export type Good = readonly [true, T]; export type Bad = readonly [false, T]; export type InferBad> = T extends (...args: any) => infer COutput ? COutput extends readonly [false, infer CGood] ? CGood : never : never; export type InferGood> = T extends (...args: any) => infer COutput ? COutput extends readonly [true, infer CGood] ? CGood : never : never; export type InferInput> = T extends Sure ? CFrom : never; export type InferMeta> = T extends Sure ? CMeta : {}; //# sourceMappingURL=core.d.ts.map