/** * @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, SchemaRequiredProp, Validator } from '../types/index.js'; import type { ResolveBinarySchema, ResolvedBinarySchema } from './resolve.js'; import { BinarySchema } from './schema.js'; import type { BinarySchemaProps } from './types.js'; type BinarySchemer = = {}>(props?: NarrowObject) => BinarySchema_; /** * Define a new schema of binary type * * @param props _(optional)_ Schema Props */ export declare const binary: BinarySchemer; /** * Number attribute (warm) */ export declare class BinarySchema_ extends BinarySchema { /** * 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): BinarySchema_>; /** * Shorthand for `required('never')` */ optional(): BinarySchema_>; /** * Hide attribute after fetch commands and formatting */ hidden(nextHidden?: NEXT_HIDDEN): BinarySchema_>; /** * Tag attribute as a primary key attribute or linked to a primary attribute */ key(nextKey?: NEXT_KEY): BinarySchema_>; /** * Rename attribute before save commands */ savedAs(nextSavedAs: NEXT_SAVED_AS): BinarySchema_>; /** * 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): BinarySchema_; }>>; /** * Shorthand for `enum(constantValue).default(constantValue)` * * @param constantValue Constant value * @example * string().const('foo') */ const>(constant: CONSTANT): If>, BinarySchema_>>; /** * Transform the attribute value in PUT commands OR Primary Key computing if attribute is tagged as key */ transform>>(transform: TRANSFORMER): BinarySchema_>; /** * Provide a default value for attribute in Primary Key computing * * @param nextKeyDefault `keyAttributeInput | (() => keyAttributeInput)` */ keyDefault(nextKeyDefault: ValueOrGetter>): BinarySchema_>; /** * Provide a default value for attribute in PUT commands * * @param nextPutDefault `putAttributeInput | (() => putAttributeInput)` */ putDefault(nextPutDefault: ValueOrGetter>): BinarySchema_>; /** * Provide a default value for attribute in UPDATE commands * * @param nextUpdateDefault `updateAttributeInput | (() => updateAttributeInput)` */ updateDefault(nextUpdateDefault: ValueOrGetter>): BinarySchema_>; /** * 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>, BinarySchema_>>; /** * Provide a **linked** default value for attribute in Primary Key computing * * @param nextKeyLink `keyAttributeInput | ((keyInput) => keyAttributeInput)` */ keyLink(nextKeyLink: (keyInput: ValidValue) => ValidValue): BinarySchema_>; /** * Provide a **linked** default value for attribute in PUT commands * * @param nextPutLink `putAttributeInput | ((putItemInput) => putAttributeInput)` */ putLink(nextPutLink: (putItemInput: ValidValue) => ValidValue): BinarySchema_>; /** * Provide a **linked** default value for attribute in UPDATE commands * * @param nextUpdateLink `unknown | ((updateItemInput) => updateAttributeInput)` */ updateLink(nextUpdateLink: (updateItemInput: UpdateValueInput>) => UpdateValueInput): BinarySchema_>; /** * 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>, BinarySchema_>>; /** * Provide a custom validator for attribute in Primary Key computing * * @param nextKeyValidator `(keyAttributeInput) => boolean | string` */ keyValidate(nextKeyValidator: Validator, this>): BinarySchema_>; /** * Provide a custom validator for attribute in PUT commands * * @param nextPutValidator `(putAttributeInput) => boolean | string` */ putValidate(nextPutValidator: Validator, this>): BinarySchema_>; /** * Provide a custom validator for attribute in UPDATE commands * * @param nextUpdateValidator `(updateAttributeInput) => boolean | string` */ updateValidate(nextUpdateValidator: Validator, this>): BinarySchema_>; /** * 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>, BinarySchema_>>; clone(nextProps?: NarrowObject): BinarySchema_>; build = SchemaAction>(Action: new (schema: this) => ACTION): ACTION; } export {};