UNPKG

@resin/pinejs

Version:

Pine.js is a sophisticated rules-driven API engine that enables you to define rules in a structured subset of English. Those rules are used in order for Pine.js to generate a database schema and the associated [OData](http://www.odata.org/) API. This make

20 lines (19 loc) 717 B
import * as Promise from 'bluebird'; export declare type RollbackAction = () => void | Promise<void>; export declare type HookFn = (...args: any[]) => any; export declare class Hook { private hookFn; constructor(hookFn: HookFn); run(...args: any[]): Promise<any>; } export declare class SideEffectHook extends Hook { private rollbackFns; private rolledBack; constructor(hookFn: HookFn); registerRollback(fn: RollbackAction): void; rollback(): Promise<void> | undefined; } export declare const rollbackRequestHooks: (request: any) => Promise<(void | Error)[]> | Promise<(Error | (void | Error)[])[]>; export declare const instantiateHooks: (hooks: any) => { [x: string]: Hook[]; };