import DynamoDB from "aws-sdk/clients/dynamodb"; declare const FilterOperations: readonly ["eq", "gt", "lt", "gte", "lte", "between", "begins", "exists", "notExists", "contains", "notContains"]; export declare type IndexTypes = 'pk' | 'sk'; export declare type AttributeType = 'string' | 'number' | 'boolean' | 'any' | 'enum'; export declare type Attribute = { type: AttributeType; name: string; required: boolean; readOnly: boolean; enumArray: string[]; }; export declare type Facet = { type: IndexTypes; name: string; }; declare type IndexKey = { field: string; facets: string[]; }; declare type Index = { index: string; pk: IndexKey; sk?: IndexKey; }; declare type IndexFacet = { all: Facet[]; }; export declare type InstanceAccessType = "entity" | "collection"; export declare type ElectroInstanceType = "service" | "entity" | "model"; export declare type ElectroInstances = Service | Entity; export declare type Entity = { _instance: symbol; _instanceType?: string; _getTableName(): string; _setTableName(name: string): void; client: DynamoDB.DocumentClient; identifiers: { model: string; version: string; }; query: QueryRecord; get(val: any): any; delete: QueryMethod; create: QueryMethod; patch: QueryMethod; scan: QueryOperation; find: any; model: { entity: string; service: string; facets: { byIndex: Record; fields: string[]; }; schema: { attributes: Record; }; indexes: Record; translations: { indexes: { fromIndexToAccessPattern: Record; fromAccessPatternToIndex: Record; }; }; }; }; export declare type Service = { _instance: symbol; _instanceType?: string; _getTableName(): string; _setTableName(name: string): void; client: DynamoDB.DocumentClient; entities: Record; service: { name: string; table: string; }; collectionSchema: Record; collections: QueryRecord; find: Record; }; declare type CollectionSchema = { attributes: Record; entities: Record; keys: Index & { name: string; }; }; export declare type FilterOperation = (typeof FilterOperations)[number]; export declare abstract class Instance { name: string; service: string; type: InstanceAccessType; private __hasSK; abstract getItem(): Object; abstract getAccessPatternName(index?: string): string; abstract getIndexName(accessPattern?: string): string; abstract getAccessPattern(accessPattern?: string): Index; abstract getAllKeyFieldNames(): string[]; abstract getAttributes(): Record; abstract getFacets(name?: string): Facet[]; abstract getIndexes(): Index[]; abstract getStaticProperties(): { name: string; value: string; }[]; abstract hasAccessPattern(accessPattern: string): boolean; static readonly FilterOperations: readonly ["eq", "gt", "lt", "gte", "lte", "between", "begins", "exists", "notExists", "contains", "notContains"]; static isOperation(operation?: string): operation is FilterOperation; constructor(name: string, service: string, type: InstanceAccessType); getIndexTypeName(accessPattern: string): string; getKeyFieldNames(indexName?: string): string[]; getAttribute(name: string): Attribute; getAttributeTypeName(attribute: string): string; getEnums(): Record; hasSK(): boolean; private setHasSKCache; } export declare class EntityInstance extends Instance { instance: Entity; constructor(name: string, service: string, instance: Entity); hasAccessPattern(accessPattern: string): boolean; getStaticProperties(): { name: string; value: string; }[]; getAccessPatternName(index?: string): string; getIndexName(accessPattern?: string): string; getAccessPattern(accessPattern?: string): Index; getAttributes(): Record; getFacets(name?: string): Facet[]; getAllKeyFieldNames(): string[]; getItem(): Object; getIndexes(): Index[]; } export declare class CollectionInstance extends Instance { instance: CollectionSchema; constructor(name: string, service: string, instance: CollectionSchema); hasAccessPattern(accessPattern: string): boolean; getStaticProperties(): { name: string; value: string; }[]; getAccessPatternName(): string; getIndexName(): string; getAccessPattern(): Index; getIndexes(): Index[]; getAttributes(): Record; getFacets(): Facet[]; getAllKeyFieldNames(): string[]; getItem(): { [key: string]: Object; }; } declare type QueryRecord = Record; export declare type InstanceActions = { remove?: QueryMethod; create?: QueryMethod; patch?: QueryMethod; }; export declare class ElectroInstance { name: string; isService: boolean; instances: Instance[]; service: string; electro: ElectroInstances; queries: QueryRecord; scans: QueryRecord; actions: Record; type: ElectroInstanceType; static isEntity(electro: ElectroInstances): electro is Entity; static isService(electro: ElectroInstances): electro is Service; static parse(electro: ElectroInstances): { name: string; instances: Instance[]; queries: QueryRecord; actions: Record; scans: QueryRecord; }; constructor(electro: ElectroInstances); setName(name: string): void; getInstance(accessPattern: string): undefined | Instance; eachQuery(cb: EachQueryCallback): this; eachRemove(cb: EachQueryCallback): this; eachCreate(cb: EachQueryCallback): this; eachPatch(cb: EachQueryCallback): this; } export declare type EachQueryCallback = (serviceName: string, accessPatternName: string, entity: Instance, query: QueryMethod, actions: InstanceActions) => void; declare type AttributeFilterOperation = Record string>; declare type AttributeFilter = Record; declare const whereAttributeSymbol: unique symbol; declare type WhereAttribute = typeof whereAttributeSymbol; export declare type AttributeWhere = Record; export declare type OperationWhere = Record string>; export declare type QueryConfiguration = { params?: { TableName?: string; Limit?: number; }; raw?: boolean; table?: string; }; export declare type QueryOperation = { set?: (facets: object) => QueryOperation; go: (config: QueryConfiguration) => Promise; params: (config: QueryConfiguration) => object; filter: (cb: (attr: AttributeFilter) => string) => QueryOperation; where: (cb: (attr: AttributeWhere, op: OperationWhere) => string) => QueryOperation; }; export declare type QueryMethod = (facets: object) => QueryOperation; export declare class InstanceReader { filePath: string; constructor(filePath: string); static AllowedFileTypes: string[]; static resolve(filePath: string): string; isElectroInstance(instance: any): instance is ElectroInstances; get({ table, params }?: { table?: string; params?: string; }): [ElectroInstanceType, ElectroInstances]; } export {}; //# sourceMappingURL=instance.d.ts.map