import type { Schema, Infer } from '../base.ts'; import { SCHEMA_KIND } from '../base.ts'; /** * Schema for optional values (T | undefined). * Accepts undefined or the wrapped schema's type. * * @template T - The wrapped schema type * * @example * ```typescript * const schema = s.optional(s.string()); * schema.parse('hello'); // 'hello' * schema.parse(undefined); // undefined * schema.parse(123); // throws ValidationError * ``` */ export declare class OptionalSchema> implements Schema | undefined, Infer | undefined> { readonly [SCHEMA_KIND] = "OptionalSchema"; readonly schema: T; description?: string; readonly '~standard': { version: 1; vendor: string; validate: (value: unknown) => import("@agentuity/core").StandardSchemaV1.Result | Promise>; types: { input: Infer | undefined; output: Infer | undefined; }; }; private parseMethods; constructor(schema: T); describe(description: string): this; optional(): this; nullable(): Schema | undefined | null, Infer | undefined | null>; parse: (this: Schema | undefined>, value: unknown) => Infer | undefined; safeParse: (this: Schema | undefined>, value: unknown) => import("../base.ts").SafeParseResult | undefined>; } /** * Make a schema optional (T | undefined). * * @param schema - The schema to make optional * * @example * ```typescript * const userSchema = s.object({ * name: s.string(), * nickname: s.optional(s.string()) * }); * ``` */ export declare function optional>(schema: T): OptionalSchema; //# sourceMappingURL=optional.d.ts.map