/** * A specific set of possible values that need to be checked for requirements. * * @param T - * The type of value that is being checked. */ export type ZObligatedValue = T | null | undefined | Promise; /** * Requires a value to be non null. * * @param val - * The value to require. This can be a promise * that can return null or undefined in addition to the * value. * @param T - * The type of value that is being checked. * * @returns * This method returns val if it is not null * or undefined, otherwise, an error is thrown. * * @throws * An error if the value is null or undefined. */ export declare function required(val: ZObligatedValue): Promise; /** * Allows a value to be null or undefined and has a fallback. * * @param val - * The value to check. This can be a promise * that can return null or undefined in addition to the * value. * @param fallback - * The fallback value in the case that val is * null or undefined. * @param T - * The type of value that is being checked. * * @returns * This method returns val if it is not null * or undefined, otherwise, the fallback is returned. * If val is a promise and rejects, then fallback is * also returned. */ export declare function optional(val: ZObligatedValue, fallback: T): Promise; /** * Allows a value to be null or undefined and has a fallback. * * @param val - * The value to check. This can be a promise * that can return null or undefined in addition to the * value. * @param T - * The type of value that is being checked. * * @returns * This method returns val if it is not null * or undefined, otherwise, null is returned. * If val is a promise and rejects, then null is * also returned. */ export declare function optional(val: ZObligatedValue): Promise;