import * as v from '@badrap/valita'; export * from '@badrap/valita'; /** * 'strip' allows unknown properties and removes unknown properties. * 'strict' errors if there are unknown properties. * 'passthrough' allows unknown properties. */ export type ParseOptionsMode = 'passthrough' | 'strict' | 'strip'; export declare function parse(value: unknown, schema: v.Type, mode?: ParseOptionsMode): T; export declare function is(value: unknown, schema: v.Type, mode?: ParseOptionsMode): value is T; export declare function assert(value: unknown, schema: v.Type, mode?: ParseOptionsMode): asserts value is T; type Result = { ok: true; value: T; } | { ok: false; error: string; }; export declare function test(value: unknown, schema: v.Type, mode?: ParseOptionsMode): Result; /** * Similar to {@link test} but works for AbstractTypes such as Optional. * This is for advanced usage. Prefer {@link test} unless you really need * to operate directly on an Optional field. */ export declare function testOptional(value: unknown, schema: v.Type | v.Optional, mode?: ParseOptionsMode): Result; /** * Shallowly marks the schema as readonly. */ export declare function readonly(t: T): v.Type>>; export declare function readonlyObject>(t: T): v.ObjectType, undefined>; export declare function readonlyArray(t: T): v.Type[]>; export declare function readonlyRecord(t: T): v.Type>>>; declare const AbstractType: any; export declare function instanceOfAbstractType(obj: unknown): obj is v.Type | v.Optional; type ObjectShape = Record; /** * Similar to `ObjectType.partial()` except it recurses into nested objects. * Rest types are not supported. */ export declare function deepPartial(s: v.ObjectType): v.ObjectType<{ [K in keyof Shape]: v.Optional>; }, undefined>; type Literal = string | number | bigint | boolean; export declare function literalUnion(...literals: T): v.Type; //# sourceMappingURL=valita.d.ts.map