import type { AnyCustomObjectDefinition, CreateInput, FieldNames, LogicalCategoryName, LogicalCustomFieldName, LogicalCustomObjectName, RecordShape, UpdateInput } from "./types.js"; /** Single validation failure returned by schema or record validators. */ export interface ValidationIssue { readonly path: string; readonly message: string; } /** Aggregate validation result returned by runtime validation helpers. */ export interface ValidationResult { readonly valid: boolean; readonly issues: readonly ValidationIssue[]; } /** * Throws when a logical custom-object name is invalid. * * @param value - Candidate logical custom-object name to validate. * @typeParam TObjectName - Candidate logical custom-object name. */ export declare function validateLogicalCustomObjectName(value: LogicalCustomObjectName | string): asserts value is LogicalCustomObjectName; /** * Throws when a logical category name is invalid. * * @param value - Candidate logical category name to validate. * @typeParam TCategoryName - Candidate logical category name. */ export declare function validateLogicalCategoryName(value: LogicalCategoryName | string): asserts value is LogicalCategoryName; /** * Throws when a logical custom-field name is invalid. * * @param value - Candidate logical custom-field name to validate. * @typeParam TFieldName - Candidate logical custom-field name. */ export declare function validateLogicalCustomFieldName(value: LogicalCustomFieldName | string): asserts value is LogicalCustomFieldName; /** * Validates a schema definition after the type system has done its part. * * @param definition - Typed object definition to validate at runtime. * @returns Validation issues describing any remaining runtime-level problems. */ export declare function validateCustomObjectDefinition(definition: AnyCustomObjectDefinition): ValidationIssue[]; /** * Runtime validator for create payloads derived from a schema definition. * * @param definition - Object definition whose create payload is being validated. * @param input - Candidate create payload expressed with logical field names. * @returns Aggregate validation result for the supplied create payload. * @typeParam TDefinition - Object definition whose create payload is being validated. */ export declare function validateCreateInput(definition: TDefinition, input: Record): ValidationResult; /** * Runtime validator for update payloads derived from a schema definition. * * @param definition - Object definition whose update payload is being validated. * @param input - Candidate update payload expressed with logical field names. * @returns Aggregate validation result for the supplied update payload. * @typeParam TDefinition - Object definition whose update payload is being validated. */ export declare function validateUpdateInput(definition: TDefinition, input: Record): ValidationResult; /** * Throws a detailed error when a create payload is invalid. * * @param definition - Object definition whose create payload is being asserted. * @param input - Candidate create payload expressed with logical field names. * @typeParam TDefinition - Object definition whose create payload is being asserted. */ export declare function assertValidCreateInput(definition: TDefinition, input: Record): asserts input is CreateInput; /** * Throws a detailed error when an update payload is invalid. * * @param definition - Object definition whose update payload is being asserted. * @param input - Candidate update payload expressed with logical field names. * @typeParam TDefinition - Object definition whose update payload is being asserted. */ export declare function assertValidUpdateInput(definition: TDefinition, input: Record): asserts input is UpdateInput; /** * Casts a generic record object into the strongly typed shape derived from the * schema. * * This helper does not perform runtime validation by itself; pair it with a * schema-aware check when the source data is not trusted. * * @param _definition - Object definition whose record shape should be applied. * @param record - Generic record object to cast into the typed record shape. * @returns Record cast to the schema-derived typed record shape. * @typeParam TDefinition - Object definition whose record shape should be applied. */ export declare function asTypedRecord(_definition: TDefinition, record: Record): RecordShape; /** * Convenience helper for pulling a known field value out of a typed record. * * @param record - Typed record to read from. * @param fieldName - Logical field name to read. * @returns Typed value stored at the requested field name. * @typeParam TDefinition - Object definition that produced the record shape. * @typeParam TFieldName - Logical field name being read from the record. */ export declare function getRecordValue>(record: RecordShape, fieldName: TFieldName): RecordShape[TFieldName]; //# sourceMappingURL=validation.d.ts.map