import './Symbol.asyncIterator'; import { Schema, SchemaOptions, SchemaProperties, SchemaValidationOptions } from 'tdv'; import { ValidationResult } from 'joi'; import AWS from 'aws-sdk'; import { DocumentClient } from 'aws-sdk/clients/dynamodb'; import { Database } from './database'; import { Hook } from './hook'; import { Put } from './put'; import { Get } from './get'; import { Query } from './query'; import { Scan } from './scan'; import { Update } from './update'; import { Delete } from './delete'; import { BatchGet } from './batchGet'; import { BatchWrite } from './batchWrite'; export * from './database'; export declare const $hook: unique symbol; export declare class Model extends Database { static readonly timestamps: any; static init(this: ModelStatic, props: SchemaProperties, options?: ModelOptions): M; static create(this: ModelStatic, props: SchemaProperties, options?: ModelOptions): Promise; static put(this: ModelStatic, Item: DocumentClient.PutItemInputAttributeMap): Put; static get(this: ModelStatic, Key: DocumentClient.Key): Get; static query(this: ModelStatic, Key?: DocumentClient.Key): Query; static scan(this: ModelStatic): Scan; static update(this: ModelStatic, Key: DocumentClient.Key): Update; static delete(this: ModelStatic, Key: DocumentClient.Key): Delete; static batch(this: ModelStatic): { get(...GetKeys: AWS.DynamoDB.DocumentClient.Key[]): BatchGet; put(...PutItems: AWS.DynamoDB.DocumentClient.PutItemInputAttributeMap[]): BatchWrite; delete(...DeleteKeys: AWS.DynamoDB.DocumentClient.Key[]): BatchWrite; }; ['constructor']: ModelStatic; constructor(props?: any, options?: ModelOptions); isNew(): boolean; protected readonly [$hook]: Hook; pre(name: string, fn: Function): this; post(name: string, fn: Function): this; validate(options?: SchemaValidationOptions): ValidationResult; protected readonly _validate: (options?: SchemaValidationOptions) => ValidationResult; readonly save: (options?: any) => Put; delete(options?: any): Promise; } export declare type ModelStatic = typeof Schema & typeof Database & typeof Model & { new (...args: any[]): T; }; export interface ModelOptions extends SchemaOptions { isNew?: boolean; }