import { Schema, SchemaMappedType, SchemaType } from '../schema'; import { OptionalizeObject } from '../typeUtils'; type AnyObjectSchema = Record, ObjectXmlOptions? ]>; type AllValues = { [P in keyof T]: { key: P; value: T[P][0]; schema: T[P][1]; }; }[keyof T]; export type MappedObjectType = OptionalizeObject<{ [P in AllValues['value']]: SchemaMappedType, { value: P; }>['schema']>; }>; export type ObjectType = OptionalizeObject<{ [K in keyof T]: SchemaType; }>; export interface ObjectXmlOptions { isAttr?: boolean; xmlName?: string; } export interface StrictObjectSchema, ObjectXmlOptions?]>> extends Schema, MappedObjectType> { readonly objectSchema: T; } export interface ObjectSchema, ObjectXmlOptions?]>> extends Schema & { [key: string]: unknown; }, MappedObjectType & { [key: string]: unknown; }> { readonly objectSchema: T; } export interface ExtendedObjectSchema, ObjectXmlOptions?]>, K extends string, U> extends Schema & { [key in K]?: Record; }, MappedObjectType & { [key in K]?: Record; }> { readonly objectSchema: T; } /** * Create a Strict Object type schema. * * A strict-object does not allow additional properties during mapping or * unmapping. Additional properties will result in a validation error. */ export declare function strictObject, ObjectXmlOptions?]>>(objectSchema: T): StrictObjectSchema; /** * Create an Expandable Object type schema, allowing all additional properties. * * The object schema allows additional properties during mapping and unmapping. The * additional properties are copied over as is. */ export declare function expandoObject, ObjectXmlOptions?]>>(objectSchema: T): ObjectSchema; /** * Create an Expandable Object type schema, allowing only typed additional properties. * * The object schema allows additional properties during mapping and unmapping. The * additional properties are copied over in a Record> * with key represented by K. */ export declare function typedExpandoObject, ObjectXmlOptions?]>, K extends string, S extends Schema>(objectSchema: T, additionalPropertyKey: K, additionalPropertySchema: S): ExtendedObjectSchema>; /** * Create an Object Type schema. * * The Object schema allows additional properties during mapping and unmapping * but discards them. */ export declare function object, ObjectXmlOptions?]>>(objectSchema: T): StrictObjectSchema; /** * Create a strict-object schema that extends an existing schema. */ export declare function extendStrictObject, ObjectXmlOptions?]>, A extends string, B extends Record, ObjectXmlOptions?]>>(parentObjectSchema: StrictObjectSchema, objectSchema: B): StrictObjectSchema; /** * Create an object schema that extends an existing schema. */ export declare function extendExpandoObject, ObjectXmlOptions?]>, A extends string, B extends Record, ObjectXmlOptions?]>>(parentObjectSchema: ObjectSchema, objectSchema: B): ObjectSchema; /** * Create an Object schema that extends an existing object schema. */ export declare function extendObject, ObjectXmlOptions?]>, A extends string, B extends Record, ObjectXmlOptions?]>>(parentObjectSchema: StrictObjectSchema, objectSchema: B): StrictObjectSchema; export {}; //# sourceMappingURL=object.d.ts.map