import type { Schema } from "./Schema.js"; import { ThroughSchema, type ThroughSchemaOptions } from "./ThroughSchema.js"; export interface OptionalSchemaOptions extends ThroughSchemaOptions { /** Default value for an `OptionalSchema` can always `undefined` */ readonly value?: undefined; } /** * Validate a property in an optional way, i.e. it can be the value, or `undefined` * - If the prop is `undefined`, then `undefined` is returned. * - When used with `validateData()` this means the prop can be silently skipped. */ export declare class OptionalSchema extends ThroughSchema { /** Default value for an `OptionalSchema` is always `undefined` (default value is only used when a value is `undefined`, so otherwise `undefined` could never be returned as a value). */ readonly value: undefined; constructor(options: OptionalSchemaOptions); validate(unsafeValue: unknown): T | undefined; } /** Make a property of a set of data optional, i.e. it can be the value or `undefined` */ export declare const OPTIONAL: (source: Schema) => OptionalSchema;