import { MixedLocale } from './locale'; import { InternalOptions, Callback, Maybe, Optionals, Preserve } from './types'; import type { TypedSchema, Defined } from './util/types'; import type Reference from './Reference'; import Lazy from './Lazy'; import BaseSchema, { AnySchema, SchemaObjectDescription, SchemaSpec } from './schema'; export declare type Assign = { [P in keyof T]: P extends keyof U ? U[P] : T[P]; } & U; export declare type AnyObject = Record; export declare type ObjectShape = Record>; export declare type DefaultFromShape = { [K in keyof Shape]: Shape[K] extends ObjectSchema ? DefaultFromShape : Shape[K] extends { getDefault: () => infer D; } ? Preserve extends never ? Defined : Preserve : undefined; }; export declare type TypeOfShape = { [K in keyof Shape]: Shape[K] extends TypedSchema ? Shape[K]['__inputType'] : Shape[K] extends Reference ? unknown : never; }; export declare type AssertsShape = { [K in keyof Shape]: Shape[K] extends TypedSchema ? Shape[K]['__outputType'] : Shape[K] extends Reference ? unknown : never; }; export declare type ObjectSchemaSpec = SchemaSpec & { noUnknown?: boolean; }; export default class ObjectSchema> = TypeOfShape, TOut extends Maybe> = AssertsShape | Optionals> extends BaseSchema { fields: TShape; spec: ObjectSchemaSpec; private _sortErrors; private _nodes; private _excludedEdges; constructor(spec?: TShape); protected _typeCheck(value: any): value is NonNullable; protected _cast(_value: any, options?: InternalOptions): any; protected _validate(_value: any, opts: InternalOptions | undefined, callback: Callback): void; clone(spec?: ObjectSchemaSpec): this; concat>(schema: TOther): TOther extends ObjectSchema ? ObjectSchema | Optionals> : never; concat(schema: this): this; getDefaultFromShape(): DefaultFromShape; protected _getDefault(): any; shape(additions: TNextShape, excludes?: [string, string][]): ObjectSchema, TContext, TypeOfShape> | Optionals>; pick(keys: string[]): any; omit(keys: string[]): any; from(from: string, to: keyof TShape, alias?: boolean): this; noUnknown(noAllow?: boolean, message?: import("./types").Message<{}>): this; unknown(allow?: boolean, message?: import("./types").Message<{}>): this; transformKeys(fn: (key: string) => string): this; camelCase(): this; snakeCase(): this; constantCase(): this; describe(): SchemaObjectDescription; } export declare function create(spec?: TShape): OptionalObjectSchema, TypeOfShape>; export declare namespace create { var prototype: ObjectSchema; } export interface OptionalObjectSchema> = TypeOfShape> extends ObjectSchema { default>(def: TNextDefault | (() => TNextDefault)): TNextDefault extends undefined ? ObjectSchema : ObjectSchema>; defined(msg?: MixedLocale['defined']): DefinedObjectSchema; required(msg?: MixedLocale['required']): RequiredObjectSchema; optional(): this; notRequired(): this; nullable(isNullable?: true): OptionalObjectSchema; nullable(isNullable: false): OptionalObjectSchema>; pick(keys: TKey[]): OptionalObjectSchema, TContext, TypeOfShape> | Optionals>; omit(keys: TKey[]): OptionalObjectSchema, TContext, TypeOfShape> | Optionals>; } export interface DefinedObjectSchema>> extends ObjectSchema | Extract> { default>(def: TNextDefault | (() => TNextDefault)): TNextDefault extends undefined ? DefinedObjectSchema : DefinedObjectSchema>; defined(msg?: MixedLocale['defined']): this; required(msg?: MixedLocale['required']): RequiredObjectSchema; optional(): OptionalObjectSchema; notRequired(): OptionalObjectSchema; nullable(isNullable?: true): DefinedObjectSchema; nullable(isNullable: false): DefinedObjectSchema>; pick(keys: TKey[]): DefinedObjectSchema, TContext, TypeOfShape> | Optionals>; omit(keys: TKey[]): DefinedObjectSchema, TContext, TypeOfShape> | Optionals>; } export interface RequiredObjectSchema>> extends ObjectSchema> { default>(def: TNextDefault | (() => TNextDefault)): TNextDefault extends undefined ? RequiredObjectSchema : RequiredObjectSchema>; defined(msg?: MixedLocale['defined']): DefinedObjectSchema; required(msg?: MixedLocale['required']): this; optional(): OptionalObjectSchema; notRequired(): OptionalObjectSchema; nullable(isNullable?: true): RequiredObjectSchema; nullable(isNullable: false): RequiredObjectSchema>; pick(keys: TKey[]): RequiredObjectSchema, TContext, TypeOfShape> | Optionals>; omit(keys: TKey[]): RequiredObjectSchema, TContext, TypeOfShape> | Optionals>; }