/** * Entity (pure definition layer) — builds the AWS-free half of an Entity: * the domain model binding, primary key + index definitions, system-field * configuration, unique constraints, and the derived schemas (`inputSchema`, * `updateSchema`, `createSchema`). * * This module is AWS-SDK-free in BOTH its runtime import graph and its * emitted `.d.ts` surface. The full `effect-dynamodb` package extends the * {@link EntityDefinition} produced here with the AWS-coupled CRUD/query * operations (DynamoClient, Marshaller, expression compilation), reusing * {@link buildEntityDefinition} so the derivation has a single source of truth. * * `Entity.make()` here returns a pure {@link EntityDefinition}. Consumers who * only need the derived schemas (e.g. HttpApi payloads, validation) can import * it from `@effect-dynamodb/schema` without pulling the AWS SDK into their * dependency graph or type surface. */ import { Duration, type Schema } from "effect"; import { type ConfiguredModel, type DynamoEncoding, type ExternalConfig, type ExternalPackedConfig, type ExtractIdentifier, type ExtractOffloadFields, type ExtractPackedFields, type ExtractUnremovableFields, type NoOffload, type OffloadFields, type PackedConfig, type SparseConfig } from "./DynamoModel.js"; import type * as DynamoSchema from "./DynamoSchema.js"; import type { RefEntity } from "./internal/AggregateEdges.js"; import type { CascadeIndexConfig, GeneratedIdConfig, OffloadConfig, ResolvedOffload, SoftDeleteConfig, TimeSeriesConfig, TimestampsConfig, UniqueConfig, UniqueConstraintDef, VersionedConfig } from "./internal/EntityConfig.js"; import { type DerivedSchemas, type ResolvedSystemFields } from "./internal/EntitySchemas.js"; import type { DimensionFieldNames, EntityRefCreateType, EntityRefInputType, EntityRefUpdateType, KeyFields, ModelFieldName, PrefixFieldNames, VersionFieldName } from "./internal/EntityTypes.js"; import type { GsiConfig, IndexDefinition, KeyPart, ZOrderKeyPart, ZOrderSkPart } from "./KeyComposer.js"; import type { VectorIndexConfig, VectorIndexDefinition } from "./VectorIndex.js"; import type { DimensionFor } from "./ZOrder.js"; export type { IndexDefinition, KeyPart, ZOrderKeyPart }; export type { OffloadConfig, ResolvedOffload }; /** * A ref config object: the entity and optional cascade index config. * * `entity` is typed against the structural {@link RefEntity} carrier — the * minimal `{ _tag, entityType, model, indexes, schemas }` shape that BOTH a pure * `EntityDefinition` and a runtime `Entity` satisfy. This is what lets a single * `AnyRefValue` be shared across the schema and runtime packages (the runtime * `Entity` carries `_configure` with a narrower param than the pure definition, * so neither full entity type is assignable to the other — but both satisfy * `RefEntity`). It also means a ref target may be authored in either package. */ export interface AnyRefValue { readonly entity: RefEntity; readonly cascade?: CascadeIndexConfig; } /** * Normalize a TTL config value to whole seconds. * * Accepts a `Duration.Duration` or a humanized string (e.g. `"7 days"`, * `"24 hours"`), parsed via Effect's `Duration` input grammar. A bare `number` * is intentionally NOT accepted at the type level — `Duration.fromInput` treats * a number as **milliseconds**, so `3600` would silently mean 3.6 s (a 1000× * footgun); callers must pass `Duration.seconds(3600)` or `"3600 seconds"`. * * Throws `[EDD-9005]` for a non-finite (infinite) duration — an infinite TTL * epoch is nonsensical. {@link make} validates every configured TTL eagerly via * this helper, so the write path never observes an invalid value. */ export declare const normalizeTtlSeconds: (input: Duration.Duration | string) => number; /** * Extract the optional TTL from a unique-constraint definition. Only the object * form (`{ fields, ttl }`) carries a TTL; the bare-array form never does. * * @internal */ export declare const resolveUniqueTtl: (def: UniqueConstraintDef) => Duration.Duration | string | undefined; /** * @internal The normalised indexes type from `primaryKey` + optional GSI * configs. Shared with the runtime `Entity.make` in `effect-dynamodb`. */ export type NormalizedIndexes>> = keyof TGsiIndexes extends never ? { readonly primary: TPrimaryKey; } : { readonly primary: TPrimaryKey; } & { readonly [K in keyof TGsiIndexes & string]: NormalizedGsi; }; /** * One normalised GSI. A Z-order sort key (#171) keeps its declaration on the * type — `zorder` and `prefix` are phantom carriers for the accessor typing * (the runtime value has `zorderHalf`) — beside the derived `composite`. */ type NormalizedGsi> = G["sk"] extends { readonly zorder: infer Z extends ReadonlyArray; } ? IndexDefinition & { readonly collection: G["collection"]; readonly pk: { readonly composite: G["pk"]["composite"]; }; readonly sk: ZOrderSkPart & { readonly composite: readonly [...PrefixFieldNames, ...DimensionFieldNames]; readonly zorder: Z; readonly prefix: G["sk"] extends { readonly prefix: infer P; } ? P : readonly []; }; } : IndexDefinition & { readonly collection: G["collection"]; readonly pk: { readonly composite: G["pk"]["composite"]; }; readonly sk: { readonly composite: G["sk"] extends { readonly composite: infer C; } ? C : never; }; }; /** * @internal Primary key definition — the `primaryKey` config form. `F` is the * attribute names a composite may name: on `Entity.make`, the model's fields * plus ref-derived ids ({@link KeyFields}). At least one half has a composite. */ export type PrimaryKeyDef = Omit & { readonly pk: KeyPart; readonly sk: KeyPart; /** A table's primary key can't be sharded: `shards` is an index option. */ readonly shards?: never; } & ({ readonly pk: { readonly composite: readonly [F, ...F[]]; }; } | { readonly sk: { readonly composite: readonly [F, ...F[]]; }; }); /** * @internal The configs of `Entity.make` that name model attributes, typed * from the model (`TModel`) and the refs config (`TRefs`). Shared with the * runtime `Entity.make` in `effect-dynamodb`, so both reject a misspelled * attribute name at compile time and complete the names in an editor. */ export type EntityPrimaryKeyConfig = PrimaryKeyDef & string>; /** @internal See {@link EntityPrimaryKeyConfig}: the secondary indexes. */ export type EntityIndexesConfig = globalThis.Record>>; /** * @internal See {@link EntityPrimaryKeyConfig}: unique constraints over model fields and ref ids * (`teamId` for `refs: { team }`), as a key composite names them. The ref itself is the * referenced item's data, which composes no value of its own (`EDD-9172`). */ export type EntityUniqueConfig = UniqueConfig & string, keyof TRefs>>; /** * @internal See {@link EntityPrimaryKeyConfig}: refs keyed by the model's * (ref) fields. The record half keeps it a `Record`; the * keyed half gives an editor the field names. A key that is not a model field * is refused by {@link RefsKeyGuard} on the config. */ export type EntityRefsConfig = globalThis.Record & { readonly [K in ModelFieldName]?: AnyRefValue; }; /** * @internal The keys of the refs as written (`TRefs`) that are not model * fields, each typed `never`, so the error lands on the misspelled key. Keyed * by remapping (`as`), not `Exclude`: the `Exclude` form, beside the indexes * constraint that also reads `TRefs`, made `Parameters` * resolve to `never`. */ export type RefsKeyGuard = { readonly [K in keyof TRefs as K extends ModelFieldName ? never : K]: never; }; /** Every option an entry of some kind takes, for an entry whose field the guard can't look up. */ type AnyEntryKey = "field" | "min" | "max" | "step" | "from" | "unit" | "bits" | "values" | "bytes"; /** The keys the entries over field `F` take (a bare name contributes none). */ type EntryKeysOf = D extends string ? never : keyof D; /** The keys an object entry may carry: those of the entries its field's type takes. */ type AllowedEntryKeys = E extends { readonly field: infer F extends string; } ? F extends keyof TFields ? EntryKeysOf> : AnyEntryKey : AnyEntryKey; /** * @internal Over the indexes as written (`TIndexes`): on each Z-order sort * key, every key of a `zorder` entry its field's entries don't take, and every * key of a `{ field, hash }` prefix part but those two, typed `never`, so a * misspelled option (`stpe`) is an error on that entry. Like * {@link RefsKeyGuard}, a guard on the config: in the indexes' constraint it * loses the editor's completions. */ export type ZOrderEntriesGuard = { readonly [K in keyof TIndexes]: (TIndexes[K] extends { readonly sk: infer SK; } ? { readonly sk: ZOrderHalfGuard; } : unknown) & ShardsByGuard; }; /** * @internal A `shards.by` names sort key composites of its own index (#183): any * other attribute, or any attribute on a Z-order half (no accessor can pin its * dimensions), is an error on that entry. The constraint already checks each name * against the model; `Entity.make` checks again at runtime (`EDD-9102`). */ type ShardsByGuard = TEntry extends { readonly shards: { readonly by: unknown; }; } ? { readonly shards: { readonly by: ReadonlyArray; }; } ? C[number] : never>; }; } : unknown; /** The attribute a key half is stored in, when the type says which: `Entity.make` checks the rest. */ type FieldOf = H extends { readonly field: infer F extends string; } ? string extends F ? never : F : never; /** A partition key half that holds a shard marker can't share an attribute with these. */ type AttributesOutsideShardedPks = (TPrimaryKey extends { readonly pk: infer P; readonly sk: infer S; } ? FieldOf

| FieldOf : never) | { readonly [K in keyof TIndexes]: (TIndexes[K] extends { readonly sk: infer S; } ? FieldOf : never) | (TIndexes[K] extends { readonly shards: unknown; } ? never : TIndexes[K] extends { readonly pk: infer P; } ? FieldOf

: never); }[keyof TIndexes]; /** * @internal On a sharded index, a `pk.field` that is the table's `pk` or `sk`, a sort * key's attribute, or an unsharded index's partition key attribute is an error on * that entry: the shard marker would overwrite the other key (#183). `Entity.make` * checks every other overlap at runtime (`EDD-9106`), such as two sharded indexes * with different counts. */ type ShardedPkFieldsGuard = { readonly [K in keyof TIndexes]: TIndexes[K] extends { readonly shards: unknown; readonly pk: infer P; } ? [FieldOf

] extends [never] ? unknown : FieldOf

extends AttributesOutsideShardedPks ? { readonly pk: { readonly field: never; }; } : unknown : unknown; }; /** The `versioned` attribute, when an index can't be composed from it: only `retain` reads the item. */ type UnknownVersionField = TVersioned extends { readonly retain: true; } ? never : VersionFieldName; /** One half's composites without `V`: an error on the half that holds it, nothing on any other. */ type CompositesWithout = THalf extends { readonly composite: infer C extends ReadonlyArray; } ? [Extract] extends [never] ? unknown : { readonly composite: ReadonlyArray>; } : unknown; /** A Z-order half's dimensions and prefix without `V`, as {@link CompositesWithout}. */ type ZOrderEntriesWithout = (THalf extends { readonly zorder: infer Z; } ? { readonly zorder: { readonly [I in keyof Z]: EntryWithout; }; } : unknown) & (THalf extends { readonly prefix: infer P; } ? { readonly prefix: { readonly [I in keyof P]: EntryWithout; }; } : unknown); type EntryWithout = TEntry extends V ? never : TEntry extends { readonly field: V; } ? { readonly field: never; } : unknown; /** * @internal A secondary index over the `versioned` attribute is an error on that composite, unless * `retain` makes the value known (`EDD-9121`). `Entity.make` checks again at runtime, and checks the * primary key and `shards.by`. A half that doesn't hold it gets `unknown`, so it loses no completions. */ type VersionCompositesGuard = [UnknownVersionField] extends [ never ] ? unknown : { readonly [K in keyof TIndexes]: (TIndexes[K] extends { readonly pk: infer P; } ? { readonly pk: CompositesWithout>; } : unknown) & (TIndexes[K] extends { readonly sk: infer S; } ? { readonly sk: CompositesWithout> & ZOrderEntriesWithout>; } : unknown); }; /** * @internal {@link ZOrderEntriesGuard} over the fields `Entity.make`'s keys name, * {@link ShardedPkFieldsGuard} over its primary key, and {@link VersionCompositesGuard} over its * `versioned` config. */ export type EntityIndexesGuard = ZOrderEntriesGuard>> & ShardedPkFieldsGuard & VersionCompositesGuard; type ZOrderHalfGuard = (SK extends { readonly zorder: infer Z; } ? { readonly zorder: { readonly [I in keyof Z]: Z[I] extends string ? unknown : { readonly [P in Exclude>]: never; }; }; } : unknown) & (SK extends { readonly prefix: infer P; } ? { readonly prefix: { readonly [I in keyof P]: P[I] extends string ? unknown : { readonly [Q in Exclude]: never; }; }; } : unknown); /** * @internal The refs `Entity.make` was given, or `undefined` when it was given * none. `TRefs` has no default so that, while an editor completes inside * `refs`, it falls back to its constraint (which lists the model's fields) * instead of to a default of `undefined` (which lists nothing); left out, it * resolves to that constraint, which includes `undefined` and maps here to * `undefined`. */ export type RefsOrNone = undefined extends TRefs ? undefined : TRefs; /** @internal See {@link EntityPrimaryKeyConfig}: the time-series clock and append input. */ export type EntityTimeSeriesConfig = TimeSeriesConfig>; /** @internal See {@link EntityPrimaryKeyConfig}: the auto-generated id field. */ export type EntityGeneratedIdConfig = GeneratedIdConfig>; /** @internal See {@link EntityPrimaryKeyConfig}: vector indexes over model fields. */ export type EntityVectorIndexesConfig = globalThis.Record>>; /** * @internal A `timeSeries.appendInput` field that is not a model field: its * name, as a type error on `appendInput` (`never` when every field is one). */ export type AppendInputFields = TTimeSeries extends { readonly appendInput: infer A extends Schema.Top; } ? string extends ModelFieldName ? unknown : [Exclude, ModelFieldName>] extends [never] ? unknown : { readonly appendInput: `EDD-9013: appendInput field "${Exclude, ModelFieldName>}" is not a model field`; } : unknown; interface ResolvedRef { readonly fieldName: string; readonly idFieldName: string; /** The attribute of the referenced entity a `${field}Id` names (`refIdAttribute`). */ readonly keyField: string; /** The schema a `${field}Id` is taken as: `keyField`'s own field. */ readonly keySchema: Schema.Top; readonly refEntity: EntityDefinition; readonly refEntityType: string; } /** * @internal The full bundle of pure locals produced by * {@link buildEntityDefinition}. The runtime `effect-dynamodb` package consumes * this bundle to attach CRUD/query operations without re-running derivation. */ export interface EntityDefinitionData { readonly configuredAttributes: globalThis.Record; readonly rawModel: Schema.Top; readonly isSchemaClass: boolean; readonly modelFields: globalThis.Record; readonly hasHiddenFields: boolean; readonly systemFields: ResolvedSystemFields; readonly validCompositeFields: ReadonlySet; readonly resolvedRefs: ReadonlyArray; readonly hasRefs: boolean; readonly cascadeIndexes: globalThis.Record; readonly initialIndexes: globalThis.Record; readonly immutableFields: ReadonlySet; readonly resolvedIdentifier: string | undefined; readonly fieldEncodings: globalThis.Record; readonly schemas: DerivedSchemas; readonly entityType: string; readonly entityVersion: number; readonly sparseFields: globalThis.Record; readonly hasSparseFields: boolean; /** Domain field name → packed storage config (`storedAs: DynamoModel.Packed`). */ readonly packedFields: Readonly>; /** Stored attribute name (after `field` renames) → packed storage config. */ readonly packedAttributes: Readonly>; /** * Stored attribute names read by their stored form (packed ones plus every * object/array-shaped field — see `internal/EntityPacked.ts`). */ readonly dispatchAttributes: ReadonlyArray; readonly hasPackedFields: boolean; /** Domain field name → config, for every `External` (binary) field (#179). */ readonly externalFields: Readonly>; /** Domain field name → config, for every overflow field (`Packed({ external })`, #179). */ readonly overflowFields: Readonly>; /** The resolved offload settings; `undefined` when the entity offloads nothing. */ readonly offload: ResolvedOffload | undefined; readonly fieldRenames: globalThis.Record; readonly hasRenames: boolean; readonly renameToDynamo: (item: globalThis.Record) => void; readonly renameFromDynamo: (item: globalThis.Record) => void; readonly resolveDbName: (domainName: string) => string; readonly generatedIdField: string | undefined; readonly generatedIdVersion: string | undefined; /** Normalized vector index declarations, keyed by logical name. */ readonly vectorIndexes: globalThis.Record; readonly hasVectorIndexes: boolean; } /** * @internal The normalized config a definition was built from — model, entity * type, indexes (with `primary`), and all lifecycle/ref configuration. Retained * on the pure definition so the runtime `effect-dynamodb` package can promote it * to a full operational `Entity` (attaching CRUD/query operations) without the * caller re-authoring it. Mirrors the input to {@link buildEntityDefinition}. */ export interface EntityDefinitionConfig { readonly model: Schema.Top | ConfiguredModel; readonly entityType: string; readonly indexes: globalThis.Record & { readonly primary: IndexDefinition; }; readonly timestamps?: TimestampsConfig | undefined; readonly versioned?: VersionedConfig | undefined; readonly softDelete?: SoftDeleteConfig | undefined; readonly unique?: UniqueConfig | undefined; readonly refs?: globalThis.Record | undefined; readonly timeSeries?: TimeSeriesConfig | undefined; readonly generatedId?: GeneratedIdConfig | undefined; readonly vectorIndexes?: globalThis.Record | undefined; readonly offload?: OffloadConfig | undefined; } /** * The pure definition produced by {@link make}. Carries the model binding, * index definitions, system-field configuration, derived schemas, and the * `_configure` hook used by the runtime binding layer. Does * NOT carry AWS-coupled CRUD/query operations — those live on the runtime * `effect-dynamodb` `Entity` type, which extends this. */ export interface EntityDefinition = globalThis.Record, TTimestamps extends TimestampsConfig | undefined = TimestampsConfig | undefined, TVersioned extends VersionedConfig | undefined = VersionedConfig | undefined, TSoftDelete extends SoftDeleteConfig | undefined = SoftDeleteConfig | undefined, TUnique extends UniqueConfig | undefined = UniqueConfig | undefined, TRefs extends globalThis.Record | undefined = undefined, TIdentifier extends string | undefined = undefined, TTimeSeries extends TimeSeriesConfig | undefined = undefined, TGeneratedId extends GeneratedIdConfig | undefined = undefined, TVectorIndexes extends globalThis.Record | undefined = undefined, TPackedFields extends string = never, TUnremovable extends string = never, TOffload extends OffloadFields = NoOffload> { readonly _tag: "Entity"; readonly model: TModel; readonly entityType: TEntityType; readonly indexes: TIndexes; readonly timestamps: TTimestamps; readonly versioned: TVersioned; readonly softDelete: TSoftDelete; readonly unique: TUnique; readonly identifier: TIdentifier; readonly timeSeries: TTimeSeries; readonly generatedId: TGeneratedId; /** Vector index declarations as authored (see `DESIGN.md §14`). */ readonly vectorIndexes: TVectorIndexes; /** * The resolved offload settings (#179): `itemBudget` and `prefix` from * `Entity.make({ offload })`, and the domain names of the `overflow` * (`Packed({ external })`) and `binary` (`External()`) fields. `undefined` * when the entity offloads nothing. */ readonly offload: ResolvedOffload | undefined; /** * @internal Type-only (never set at runtime): the domain names of the fields * this entity offloads, by kind ({@link NoOffload} when none) — what the * runtime's operation types add `BlobStoreError` from (#179, §9.1). */ readonly _offloadFields?: TOffload | undefined; /** * @internal Normalized vector index definitions keyed by logical name. The * runtime package reads these to emit `CreateTable.VectorIndexes`, compose * partition attributes on writes, and build search accessors. */ readonly _vectorIndexes: globalThis.Record; /** * @internal Domain field name → the attribute it is stored under (a `field:` rename), as the * runtime entity resolves it. A table's definition reads it to name a vector index's filter * attributes. */ readonly _resolveDbName: (domainName: string) => string; /** * The domain fields stored packed (`storedAs: DynamoModel.Packed(...)`) or * External (`storedAs: DynamoModel.External(...)`). Carries the * `TPackedFields` type, which narrows expression path builders: such a field * can be tested only with `exists` / `notExists` as a whole. */ readonly _packedFields: ReadonlyArray; /** * @internal Phantom — never read at runtime. Carries the fields * `.remove()` refuses by configuration (immutable, sparse map). */ _unremovableFields?(field: TUnremovable): void; /** @internal Resolved ref metadata — used by cascade to inspect target entities */ readonly _resolvedRefs: ReadonlyArray<{ readonly fieldName: string; readonly idFieldName: string; readonly keyField: string; readonly refEntityType: string; }>; /** @internal Attach model class prototype to a decoded plain object (no-op for Schema.Struct models). */ readonly _attachPrototype: (decoded: any) => any; /** * @internal Configure the entity with table schema and tag. * Called by DynamoClient.make() when binding entities to a table. */ readonly _configure: (schema: DynamoSchema.DynamoSchema, tableTag: unknown) => void; /** * @internal Inject a GSI index definition into this entity. */ readonly _injectIndex: (name: string, def: IndexDefinition) => void; /** @internal Injected DynamoSchema — available after _configure(). */ readonly _schema: DynamoSchema.DynamoSchema; /** @internal Injected TableConfig tag — available after _configure(). */ readonly _tableTag: unknown; /** * @internal The normalized config this definition was built from. Used by the * runtime `effect-dynamodb` package to promote a pure definition to a full * operational Entity (see {@link EntityDefinitionConfig}). */ readonly _config: EntityDefinitionConfig; /** * @internal The derived data bundle (see {@link EntityDefinitionData}). Lets * the runtime attach operations without re-running derivation — promotion is a * thin op-attach rather than a full re-derive. */ readonly _data: EntityDefinitionData; /** Resolved system field names */ readonly systemFields: ResolvedSystemFields; /** Derived schemas for type extraction */ readonly schemas: DerivedSchemas; /** * Typed input schema. Ref-aware: ref fields are replaced with branded ID fields. * Use in HttpApiEndpoint payloads or for validation. */ readonly inputSchema: Schema.Codec>; /** * Typed create schema. Input fields minus primary key composites — the common * "create" payload where IDs are auto-generated. */ readonly createSchema: Schema.Codec>; /** * Typed update schema. Partial fields minus primary key composites and immutable fields. * Ref fields are replaced with optional branded ID fields. */ readonly updateSchema: Schema.Codec>; } export declare const buildEntityDefinition: (config: { readonly model: Schema.Top | ConfiguredModel; readonly entityType: string; readonly indexes: globalThis.Record & { readonly primary: IndexDefinition; }; readonly timestamps?: TimestampsConfig | undefined; readonly versioned?: VersionedConfig | undefined; readonly softDelete?: SoftDeleteConfig | undefined; readonly unique?: UniqueConfig | undefined; readonly refs?: globalThis.Record | undefined; readonly timeSeries?: TimeSeriesConfig | undefined; readonly generatedId?: GeneratedIdConfig | undefined; readonly vectorIndexes?: globalThis.Record | undefined; readonly offload?: OffloadConfig | undefined; }) => EntityDefinitionData; /** `[EDD-9090]`: a Z-order index is never a collection member. */ export declare const zorderInCollection: (entityType: string, indexName: string) => Error; /** * Create a pure Entity definition. * * Returns an {@link EntityDefinition} carrying the model binding, index * definitions, system-field configuration, and the derived `inputSchema` / * `updateSchema` / `createSchema`. This pure form is AWS-SDK-free — import it * from `@effect-dynamodb/schema` when you only need the derived schemas (e.g. * for HttpApi payloads or validation). * * The full operational `Entity.make` (with CRUD/query operations) is exported * from `effect-dynamodb`; its return type extends {@link EntityDefinition}. * * @example * ```typescript * const Tasks = Entity.make({ * model: Task, * entityType: "Task", * primaryKey: { pk: { field: "pk", composite: ["taskId"] }, sk: { field: "sk", composite: [] } }, * }) * // typeof Tasks.inputSchema.Type → the typed input payload * ``` */ export declare const make: | undefined, const TPrimaryKey extends EntityPrimaryKeyConfig>, const TGsiIndexes extends EntityIndexesConfig> = {}, const TTimestamps extends TimestampsConfig | undefined = undefined, const TVersioned extends VersionedConfig | undefined = undefined, const TSoftDelete extends SoftDeleteConfig | undefined = undefined, const TUnique extends EntityUniqueConfig> | undefined = undefined, const TTimeSeries extends EntityTimeSeriesConfig | undefined = undefined, const TGeneratedId extends EntityGeneratedIdConfig | undefined = undefined, const TVectorIndexes extends EntityVectorIndexesConfig | undefined = undefined, const TAttrs extends {} = {}>(config: { readonly model: TModel | ConfiguredModel; readonly entityType: TEntityType; readonly primaryKey: TPrimaryKey; readonly indexes?: TGsiIndexes & EntityIndexesGuard; readonly timestamps?: TTimestamps; readonly versioned?: TVersioned; readonly softDelete?: TSoftDelete; readonly unique?: TUnique; readonly refs?: TRefs & RefsKeyGuard; readonly timeSeries?: TTimeSeries & AppendInputFields; readonly generatedId?: TGeneratedId; readonly vectorIndexes?: TVectorIndexes; /** * Item-level offload settings (#179) — `itemBudget` and `prefix`, for an * entity with offloaded fields. See {@link OffloadConfig}. */ readonly offload?: OffloadConfig | undefined; }) => EntityDefinition, TTimestamps, TVersioned, TSoftDelete, TUnique, RefsOrNone, ExtractIdentifier>, TTimeSeries, TGeneratedId, TVectorIndexes, ExtractPackedFields> | ExtractOffloadFields>["binary"], ExtractUnremovableFields>, ExtractOffloadFields>>; //# sourceMappingURL=Entity.d.ts.map