import type { Data, Database, PartialData } from "../util/data.js"; import type { Identifier, Item } from "../util/item.js"; import { type Key } from "../util/object.js"; import type { NullableSchema } from "./NullableSchema.js"; import type { SchemaOptions, Schemas } from "./Schema.js"; import { Schema } from "./Schema.js"; /** Allowed options for `PropsSchema` (a schema that has props). */ export interface DataSchemaOptions extends SchemaOptions { readonly id?: Schema; readonly props: Schemas; readonly value?: Partial | undefined; } /** Validate a data object. */ export declare class DataSchema extends Schema { readonly value: T; readonly props: Schemas; constructor({ one, title, props, value: partialValue, ...options }: DataSchemaOptions); validate(unsafeValue?: unknown): T; pick>(...keys: K[]): DataSchema>; omit>(...keys: K[]): DataSchema>; } /** Set of named data schemas. */ export type DataSchemas = { [K in keyof T]: DataSchema; }; /** Create a `DataSchema` for a set of properties. */ export declare const DATA: (props: Schemas) => DataSchema; /** Valid data object with specifed properties, or `null` */ export declare const NULLABLE_DATA: (props: Schemas) => NullableSchema; /** Create a `DataSchema` that validates partially, i.e. properties can be their value, or `undefined` */ export declare function PARTIAL(source: Schemas | DataSchema): DataSchema>; /** Create a `DataSchema` that validates a data item, i.e. it has a string or number `.id` identifier property. */ export declare function ITEM(id: Schema, schemas: Schemas | DataSchema): DataSchema>;