import { CollectionQuery } from '@zola_do/collection-query'; import { CrudContextPayload, CrudHookContext, CrudHookOperationName, CrudWherePayload, CrudWriteFilterOptions, EntityCrudOptions, ExtraCrudOptions } from '../types'; import { CrudRequestContextResolver } from '../request-context'; type HookName = 'beforeCreate' | 'afterCreate' | 'beforeFindAll' | 'afterFindAll' | 'beforeFindOne' | 'afterFindOne' | 'beforeUpdate' | 'afterUpdate' | 'beforeDelete' | 'afterDelete' | 'beforeSoftDelete' | 'afterSoftDelete' | 'beforeRestore' | 'afterRestore' | 'beforeBulkCreate' | 'afterBulkCreate' | 'beforeBulkDelete' | 'afterBulkDelete' | 'beforeAssignFirst' | 'afterAssignFirst' | 'beforeAssignSecond' | 'afterAssignSecond'; export type RunCrudHookParams = { id?: string; itemData?: CrudContextPayload; entity?: CrudContextPayload; req?: any; service?: any; repository?: any; }; export declare const runCrudHook: (options: Record | undefined, hookName: HookName, params: RunCrudHookParams) => Promise; type CreateOptions = EntityCrudOptions | ExtraCrudOptions | undefined; type EntityOptions = EntityCrudOptions | ExtraCrudOptions | undefined; export declare const createCrudHookContext: (params: { operation: CrudHookOperationName; req?: any; params?: Record; query?: Record; id?: string; itemData?: CrudContextPayload; where?: CrudWherePayload; entity?: CrudContextPayload; result?: any; service?: any; repository?: any; }) => CrudHookContext; export declare const runBeforeOperationHooks: (options: EntityOptions, context: CrudHookContext) => Promise; export declare const runAfterOperationHooks: (options: EntityOptions, context: CrudHookContext) => Promise; export declare const runCrudPolicyScope: (options: EntityOptions, context: CrudHookContext) => Promise; export declare const runOperationAuthorization: (options: EntityOptions, context: CrudHookContext) => Promise; export declare const applyWhereToCollectionQuery: (query: CollectionQuery, where?: CrudWherePayload) => void; export declare const runBeforeCreatePipeline: (params: { itemData: CrudContextPayload; req?: any; options?: CreateOptions; resolver?: CrudRequestContextResolver; service?: any; repository?: any; }) => Promise; export declare const sanitizeWritePayload: (itemData: CrudContextPayload, options?: CrudWriteFilterOptions) => CrudContextPayload; export {};