/** * Object validation core module * Provides validation functionality for objects with type-specific validation rules for each property */ import type { PickPartial } from "../../types/object"; import { type StandardSchemaV1 } from "../../Validate/standardSchema"; import type { OptionalKeys, ValidateCoreReturnType, ValidateType } from "../../Validate/type"; export type { StandardSchemaV1 } from "../../Validate/standardSchema"; /** * Shape map describing per-property validators consumed by `object()` */ export interface ObjectShape { [key: string]: (value: any) => ValidateCoreReturnType; } /** * Resolved property map produced by applying `ValidateType` to every shape * entry. Each property maps a `ValidateType` tag (such as `"string"`, * `"number"`) back to the runtime type expected at that key. */ export type ObjectShapeProperties = { [key in keyof T]: ValidateType["type"]>; }; /** * Inferred object type produced by `object()`. Splits the property map into * required and optional halves via `PickPartial` + `OptionalKeys` so optional * properties surface with `?:` in the resulting type. */ export type InferObject = { [key in keyof PickPartial, OptionalKeys>>]: PickPartial, OptionalKeys>>[key]; }; /** * Object validator augmented with the original `shape` map. The shape map is * exposed so derived helpers such as `pick()`, `omit()`, `partial()`, and * `required()` can compose new object validators from existing ones. */ export type ObjectValidator = ((value: InferObject) => ValidateCoreReturnType>) & { shape: T; }; /** * Creates an object validator with property-specific validation rules * @template T - Object type containing validation functions for each property * @param {T} [option] - Object containing validation functions for each property * @param {string} [message] - Custom error message for object type validation * @returns {ObjectValidator} - Validator function with `.shape` attached so it can compose with `pick()`, `omit()`, `partial()`, and `required()` */ export declare const object: (option?: T, message?: string) => ObjectValidator & StandardSchemaV1, InferObject>;