import type { Schema, Infer } from '../base.ts'; import { SCHEMA_KIND } from '../base.ts'; import { OptionalSchema } from '../utils/optional.ts'; type ObjectShape = Record>; type IsOptional = T extends OptionalSchema ? true : false; type RequiredKeys = { [K in keyof T]: IsOptional extends true ? never : K; }[keyof T]; type OptionalKeys = { [K in keyof T]: IsOptional extends true ? K : never; }[keyof T]; type InferObjectShape = { [K in RequiredKeys]: Infer; } & { [K in OptionalKeys]?: Infer; }; type PartialShape = { [K in keyof T]: OptionalSchema; }; type PickShape = Pick; type OmitShape = Omit; type ExtendShape = Omit & U; /** * Schema for validating objects with typed properties. * Validates each property according to its schema and collects all validation errors. * * @template T - The object shape definition * * @example * ```typescript * const userSchema = s.object({ * name: s.string(), * age: s.number(), * email: s.string() * }); * * const user = userSchema.parse({ * name: 'John', * age: 30, * email: 'john@example.com' * }); * ``` */ export declare class ObjectSchema implements Schema, InferObjectShape> { private shape; readonly [SCHEMA_KIND] = "ObjectSchema"; description?: string; private parseMethods; constructor(shape: T); readonly '~standard': { version: 1; vendor: string; validate: (value: unknown) => import("@agentuity/core").StandardSchemaV1.FailureResult | import("@agentuity/core").StandardSchemaV1.SuccessResult>; types: { input: InferObjectShape; output: InferObjectShape; }; }; describe(description: string): this; optional(): OptionalSchema; nullable(): import("../index.ts").NullableSchema; /** * Create a new object schema with only the specified keys. * Similar to TypeScript's Pick utility type. * * @param keys - Array of keys to pick from the schema * * @example * ```typescript * const userSchema = s.object({ name: s.string(), age: s.number(), email: s.string() }); * const nameOnlySchema = userSchema.pick(['name']); * // { name: string } * ``` */ pick(keys: readonly K[]): ObjectSchema>; /** * Create a new object schema without the specified keys. * Similar to TypeScript's Omit utility type. * * @param keys - Array of keys to omit from the schema * * @example * ```typescript * const userSchema = s.object({ name: s.string(), age: s.number(), password: s.string() }); * const publicUserSchema = userSchema.omit(['password']); * // { name: string; age: number } * ``` */ omit(keys: readonly K[]): ObjectSchema>; /** * Create a new object schema where all properties are optional. * Similar to TypeScript's Partial utility type. * * @example * ```typescript * const userSchema = s.object({ name: s.string(), age: s.number() }); * const partialUserSchema = userSchema.partial(); * // { name?: string; age?: number } * ``` */ partial(): ObjectSchema>; /** * Create a new object schema by extending this schema with additional properties. * Properties in the extension override properties in the base schema. * Similar to TypeScript's intersection types with override semantics. * * @param extension - Object shape to extend with * * @example * ```typescript * const userSchema = s.object({ name: s.string(), age: s.number() }); * const adminSchema = userSchema.extend({ role: s.literal('admin'), permissions: s.array(s.string()) }); * // { name: string; age: number; role: 'admin'; permissions: string[] } * ``` */ extend(extension: U): ObjectSchema>; parse: (this: Schema>, value: unknown) => InferObjectShape; safeParse: (this: Schema>, value: unknown) => import("../base.ts").SafeParseResult>; } /** * Create an object schema with typed properties. * * @param shape - Object defining the schema for each property * * @example * ```typescript * const userSchema = s.object({ * name: s.string().describe('Full name'), * age: s.number().describe('Age in years'), * email: s.optional(s.string()) * }); * * type User = s.infer; * const user = userSchema.parse(data); * ``` */ export declare function object(shape: T): ObjectSchema; export {}; //# sourceMappingURL=object.d.ts.map