import { Database } from '@tego/server'; export type HookType = 'onSelfDestroy' | 'onCollectionDestroy' | 'onCollectionFieldDestroy' | 'onAnyCollectionFieldDestroy' | 'onSelfCreate' | 'onSelfSave' | 'onSelfMove'; export declare class ServerHooks { protected db: Database; hooks: Map>; constructor(db: Database); registerHooks(): void; listen(): void; protected callSchemaInstanceHooksByType(schemaInstance: any, options: any, type: HookType): Promise; protected onUiSchemaMove(schemaInstance: any, options: any): Promise; protected onCollectionDestroy(collectionModel: any, options: any): Promise; protected onAnyCollectionFieldDestroy(fieldModel: any, options: any): Promise; protected onCollectionFieldDestroy(fieldModel: any, options: any): Promise; protected onUiSchemaCreate(schemaInstance: any, options: any): Promise; protected onUiSchemaSave(schemaInstance: any, options: any): Promise; protected findHooksAndCall(hooksFilter: any, hooksArgs: any, transaction: any): Promise; /** * register a server hook function * @param type type of server hook * @param name name of server hook * @param hookFunc server hook function */ register(type: HookType, name: string, hookFunc: any): void; remove(type: HookType, name: string): void; }