/** * @debt circular "Remove & prevent imports from entity to schema" */ import type { UpdateValueInput } from '../../entity/actions/update/types.js'; import type { Paths, SchemaAction, ValidValue } from '../../schema/index.js'; import type { If, NarrowObject, Overwrite, ValueOrGetter } from '../../types/index.js'; import type { Always, AtLeastOnce, Never, Schema, SchemaRequiredProp, Validator } from '../types/index.js'; import type { LightTuple } from '../utils/light.js'; import { AnyOfSchema } from './schema.js'; import type { AnyOfElementSchema, AnyOfSchemaProps, Discriminator } from './types.js'; type AnyOfSchemer = (...elements: ELEMENTS) => AnyOfSchema_, {}>; /** * Define a new anyOf attribute * @param elements Attribute[] */ export declare const anyOf: AnyOfSchemer; /** * AnyOf attribute interface */ export declare class AnyOfSchema_ extends AnyOfSchema { /** * Tag attribute as required. Possible values are: * - `'atLeastOnce'` _(default)_: Required in PUTs, optional in UPDATEs * - `'never'`: Optional in PUTs and UPDATEs * - `'always'`: Required in PUTs and UPDATEs * * @param nextRequired SchemaRequiredProp */ required(nextRequired?: NEXT_IS_REQUIRED): AnyOfSchema_>; /** * Shorthand for `required('never')` */ optional(): AnyOfSchema_>; /** * Hide attribute after fetch commands and formatting */ hidden(nextHidden?: NEXT_HIDDEN): AnyOfSchema_>; /** * Tag attribute as a primary key attribute or linked to a primary attribute */ key(nextKey?: NEXT_KEY): AnyOfSchema_>; /** * Rename attribute before save commands */ savedAs(nextSavedAs: NEXT_SAVED_AS): AnyOfSchema_>; /** * Discriminates the union with a shared string attribute with enum */ discriminate>(nextDiscriminator: NEXT_DISCRIMINATOR): AnyOfSchema_>; /** * Provide a default value for attribute in Primary Key computing * * @param nextKeyDefault `keyAttributeInput | (() => keyAttributeInput)` */ keyDefault(nextKeyDefault: ValueOrGetter>): AnyOfSchema_>; /** * Provide a default value for attribute in PUT commands * * @param nextPutDefault `putAttributeInput | (() => putAttributeInput)` */ putDefault(nextPutDefault: ValueOrGetter>): AnyOfSchema_>; /** * Provide a default value for attribute in UPDATE commands * * @param nextUpdateDefault `updateAttributeInput | (() => updateAttributeInput)` */ updateDefault(nextUpdateDefault: ValueOrGetter>): AnyOfSchema_>; /** * Provide a default value for attribute in PUT commands OR Primary Key computing if attribute is tagged as key * * @param nextDefault `key/putAttributeInput | (() => key/putAttributeInput)` */ default(nextDefault: ValueOrGetter, ValidValue>>): If>, AnyOfSchema_>>; /** * Provide a **linked** default value for attribute in Primary Key computing * * @param nextKeyLink `keyAttributeInput | ((keyInput) => keyAttributeInput)` */ keyLink(nextKeyLink: (keyInput: ValidValue) => ValidValue): AnyOfSchema_>; /** * Provide a **linked** default value for attribute in PUT commands * * @param nextPutLink `putAttributeInput | ((putItemInput) => putAttributeInput)` */ putLink(nextPutLink: (putItemInput: ValidValue) => ValidValue): AnyOfSchema_>; /** * Provide a **linked** default value for attribute in UPDATE commands * * @param nextUpdateLink `unknown | ((updateItemInput) => updateAttributeInput)` */ updateLink(nextUpdateLink: (updateItemInput: UpdateValueInput>) => UpdateValueInput): AnyOfSchema_>; /** * Provide a **linked** default value for attribute in PUT commands OR Primary Key computing if attribute is tagged as key * * @param nextLink `key/putAttributeInput | (() => key/putAttributeInput)` */ link(nextLink: (keyOrPutItemInput: If, ValidValue>) => If, ValidValue>): If>, AnyOfSchema_>>; /** * Provide a custom validator for attribute in Primary Key computing * * @param nextKeyValidator `(keyAttributeInput) => boolean | string` */ keyValidate(nextKeyValidator: Validator, this>): AnyOfSchema_>; /** * Provide a custom validator for attribute in PUT commands * * @param nextPutValidator `(putAttributeInput) => boolean | string` */ putValidate(nextPutValidator: Validator, this>): AnyOfSchema_>; /** * Provide a custom validator for attribute in UPDATE commands * * @param nextUpdateValidator `(updateAttributeInput) => boolean | string` */ updateValidate(nextUpdateValidator: Validator, this>): AnyOfSchema_>; /** * Provide a custom validator for attribute in PUT commands OR Primary Key computing if attribute is tagged as key * * @param nextValidator `(key/putAttributeInput) => boolean | string` */ validate(nextValidator: Validator, ValidValue>, this>): If>, AnyOfSchema_>>; clone(nextProps?: NarrowObject): AnyOfSchema_>; build = SchemaAction>(Action: new (schema: this) => ACTION): ACTION; } export {};