UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

57 lines (56 loc) 3.13 kB
import { type ActionEventRepository, type Model, type Searchable, type Where } from '../Contracts'; import type { Fluent } from '../Models'; import CollectionRepository from './CollectionRepository'; declare const ActionEvent_base: (abstract new (...args: import("../Contracts").Args) => { insert(models: Model[]): Promise<Model[]>; forResourceStore(params: import("../Contracts").ResourceStoreActionEvent): Fluent; forResourceUpdate(params: import("../Contracts").ResourceUpdateActionEvent): Fluent; forResourceDelete(params: import("../Contracts").ResourceActionEvent): Fluent; forResourceRestore(params: import("../Contracts").ResourceActionEvent): Fluent; forActionRan(params: import("../Contracts").ResourceActionEventForAction): Fluent; defaultAttributes(params: import("../Contracts").ResourceActionEvent): import("../Contracts").AnyRecord; flush(resourceName: string, key: import("../Contracts").PrimaryKey): Promise<Model[]>; scopeResource(resourceName: string, key: import("../Contracts").PrimaryKey): any; wheres: Where[]; orders: import("../Contracts").Order[]; modifiers: import("../Contracts").QueryModifierCallback[]; _transaction?: import("../Contracts").Transaction; transaction<V>(callback: import("../Contracts").TransactionCallback<V, any>): Promise<V>; setTransaction(transaction?: import("../Contracts").Transaction): any; getTransaction(): import("../Contracts").Transaction | undefined; runningInTransaction(): boolean; prepareTransaction(): Promise<import("../Contracts").Transaction>; where(where: Where | Where[]): any; setWheres(wheres: Where[]): any; getWheres(): Where[]; order(order: import("../Contracts").Order | import("../Contracts").Order[]): any; setOrders(orders: import("../Contracts").Order[]): any; getOrders(): import("../Contracts").Order[]; modify<T>(modifier: import("../Contracts").QueryModifierCallback<T>): any; find(key: import("../Contracts").PrimaryKey): Promise<import("../Contracts").Optional<Model>>; whereKey(key: import("../Contracts").PrimaryKey): any; whereKeys(keys: Array<import("../Contracts").PrimaryKey>): any; fillModel(result: import("../Contracts").AnyRecord): Model; search(search: string, page?: number, perPage?: number): Promise<import("../Contracts").SearchCollection>; all(wheres?: Where[]): Promise<Model[]>; first(wheres?: Where[]): Promise<import("../Contracts").Optional<Model>>; store(model: Model): Promise<Model>; update(model: Model): Promise<Model>; delete(key: import("../Contracts").PrimaryKey): Promise<void>; model(): Model; }) & typeof CollectionRepository; export default class ActionEvent extends ActionEvent_base implements ActionEventRepository<Model> { /** * Get key name of the item. */ searchableColumns(): Searchable[]; /** * Store given model into the storage. */ update(model: Fluent): Promise<Fluent>; /** * Apply the where constraint on the collection item. */ checkAgainstWhere(item: Fluent, where: Where): boolean; } export {};