dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
38 lines (37 loc) • 1.23 kB
TypeScript
import type { Entity } from '../../../entity/index.js';
import { EntityAction } from '../../../entity/index.js';
import { SchemaDTO } from '../../../schema/actions/dto/index.js';
import type { ItemSchemaDTO } from '../../../schema/actions/dto/types.js';
import type { ITableDTO } from '../../../table/actions/dto/index.js';
import { TableDTO } from '../../../table/actions/dto/index.js';
type EntityAttrOption = boolean | {
name?: string;
hidden?: boolean;
};
type TimestampOption = boolean | {
name?: string;
savedAs?: string;
hidden?: boolean;
};
type TimestampOptions = boolean | {
created: TimestampOption;
modified: TimestampOption;
};
export interface IEntityDTO {
entityName: string;
entityAttribute?: EntityAttrOption;
timestamps?: TimestampOptions;
schema: ItemSchemaDTO;
table: ITableDTO;
}
export declare class EntityDTO<ENTITY extends Entity = Entity> extends EntityAction<ENTITY> implements IEntityDTO {
static actionName: "dto";
entityName: string;
schema: SchemaDTO;
entityAttribute: IEntityDTO['entityAttribute'];
timestamps: IEntityDTO['timestamps'];
table: TableDTO;
constructor(entity: ENTITY);
toJSON(): IEntityDTO;
}
export {};