/** * @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 { Transformer } from '../../transformers/index.js'; import type { If, NarrowObject, Overwrite, ValueOrGetter, Writable } from '../../types/index.js'; import type { Always, AtLeastOnce, Never, Schema, SchemaProps, SchemaRequiredProp, Validator } from '../types/index.js'; import type { ResolvedNullSchema } from './resolve.js'; import { NullSchema } from './schema.js'; import type { NullSchemaProps } from './types.js'; type NullSchemer = = {}>(props?: NarrowObject) => NullSchema_; /** * Define a new schema of null type * * @param props _(optional)_ Schema Props */ export declare const nul: NullSchemer; /** * Null attribute (warm) */ export declare class NullSchema_ extends NullSchema { /** * 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): NullSchema_>; /** * Shorthand for `required('never')` */ optional(): NullSchema_>; /** * Hide attribute after fetch commands and formatting */ hidden(nextHidden?: NEXT_HIDDEN): NullSchema_>; /** * Tag attribute as a primary key attribute or linked to a primary attribute */ key(nextKey?: NEXT_KEY): NullSchema_>; /** * Rename attribute before save commands */ savedAs(nextSavedAs: NEXT_SAVED_AS): NullSchema_>; /** * Provide a finite list of possible values for attribute * (For typing reasons, enums are only available as attribute methods, not as input props) * * @param enum Possible values * @example * string().enum('foo', 'bar') */ enum(...nextEnum: NEXT_ENUM): NullSchema_; }>>; /** * Shorthand for `enum(constantValue).default(constantValue)` * * @param constantValue Constant value * @example * string().const('foo') */ const(constant: CONSTANT): If>, NullSchema_>>; /** * Transform the attribute value in PUT commands OR Primary Key computing if attribute is tagged as key */ transform>(transform: TRANSFORMER): NullSchema_>; /** * Provide a default value for attribute in Primary Key computing * * @param nextKeyDefault `keyAttributeInput | (() => keyAttributeInput)` */ keyDefault(nextKeyDefault: ValueOrGetter>): NullSchema_>; /** * Provide a default value for attribute in PUT commands * * @param nextPutDefault `putAttributeInput | (() => putAttributeInput)` */ putDefault(nextPutDefault: ValueOrGetter>): NullSchema_>; /** * Provide a default value for attribute in UPDATE commands * * @param nextUpdateDefault `updateAttributeInput | (() => updateAttributeInput)` */ updateDefault(nextUpdateDefault: ValueOrGetter>): NullSchema_>; /** * 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>, NullSchema_>>; /** * Provide a **linked** default value for attribute in Primary Key computing * * @param nextKeyLink `keyAttributeInput | ((keyInput) => keyAttributeInput)` */ keyLink(nextKeyLink: (keyInput: ValidValue) => ValidValue): NullSchema_>; /** * Provide a **linked** default value for attribute in PUT commands * * @param nextPutLink `putAttributeInput | ((putItemInput) => putAttributeInput)` */ putLink(nextPutLink: (putItemInput: ValidValue) => ValidValue): NullSchema_>; /** * Provide a **linked** default value for attribute in UPDATE commands * * @param nextUpdateLink `unknown | ((updateItemInput) => updateAttributeInput)` */ updateLink(nextUpdateLink: (updateItemInput: UpdateValueInput>) => UpdateValueInput): NullSchema_>; /** * 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>, NullSchema_>>; /** * Provide a custom validator for attribute in Primary Key computing * * @param nextKeyValidator `(keyAttributeInput) => null | string` */ keyValidate(nextKeyValidator: Validator, this>): NullSchema_>; /** * Provide a custom validator for attribute in PUT commands * * @param nextPutValidator `(putAttributeInput) => null | string` */ putValidate(nextPutValidator: Validator, this>): NullSchema_>; /** * Provide a custom validator for attribute in UPDATE commands * * @param nextUpdateValidator `(updateAttributeInput) => null | string` */ updateValidate(nextUpdateValidator: Validator, this>): NullSchema_>; /** * Provide a custom validator for attribute in PUT commands OR Primary Key computing if attribute is tagged as key * * @param nextValidator `(key/putAttributeInput) => null | string` */ validate(nextValidator: Validator, ValidValue>, this>): If>, NullSchema_>>; clone(nextProps?: NarrowObject): NullSchema_>; build = SchemaAction>(Action: new (schema: this) => ACTION): ACTION; } export {};