/** * Entity Hook System Integration * * Provides WordPress-like hooks for entity operations * Allows plugins to extend entity behavior without modifying core code */ import type { EntityConfig } from './types'; /** * Entity operation data for hooks */ export interface EntityHookData> { entityName: string; entityConfig: EntityConfig; data?: T; userId?: string; operation: 'create' | 'read' | 'update' | 'delete'; id?: string; changes?: Partial; } /** * Entity validation result */ export interface EntityValidationResult { valid: boolean; errors: string[]; data?: unknown; } /** * Entity Hook Manager * Provides integration points for plugins to extend entity operations */ export declare class EntityHookManager { private hooks; /** * Hook: Before entity creation * Allows plugins to validate, modify, or prevent entity creation */ beforeEntityCreate(entityName: string, data: T, userId?: string): Promise; /** * Hook: After entity creation * Allows plugins to react to entity creation events */ afterEntityCreate(entityName: string, data: T, userId?: string): Promise; /** * Hook: Before entity update */ beforeEntityUpdate(entityName: string, id: string, changes: Partial, userId?: string): Promise>; /** * Hook: After entity update */ afterEntityUpdate(entityName: string, id: string, data: T, changes: Partial, userId?: string): Promise; /** * Hook: Before entity deletion */ beforeEntityDelete(entityName: string, id: string, userId?: string): Promise; /** * Hook: After entity deletion */ afterEntityDelete(entityName: string, id: string, userId?: string): Promise; /** * Hook: Entity validation * Allows plugins to add custom validation rules */ validateEntity(entityName: string, data: T, operation: 'create' | 'update'): Promise; /** * Hook: Before entity query/read */ beforeEntityRead(entityName: string, query: Record, userId?: string): Promise>; /** * Hook: After entity query/read */ afterEntityRead(entityName: string, results: T[], query: Record, userId?: string): Promise; /** * Authentication hooks */ onUserLogin(user: Record): Promise; onUserLogout(user: Record): Promise; onUserRegister(user: Record): Promise; /** * Get entity configuration (placeholder) */ private getEntityConfig; } export declare const entityHookManager: EntityHookManager; export declare const beforeEntityCreate: (entityName: string, data: T, userId?: string) => Promise; export declare const afterEntityCreate: (entityName: string, data: T, userId?: string) => Promise; export declare const beforeEntityUpdate: (entityName: string, id: string, changes: Partial, userId?: string) => Promise>; export declare const afterEntityUpdate: (entityName: string, id: string, data: T, changes: Partial, userId?: string) => Promise; export declare const beforeEntityDelete: (entityName: string, id: string, userId?: string) => Promise; export declare const afterEntityDelete: (entityName: string, id: string, userId?: string) => Promise; export declare const validateEntity: (entityName: string, data: T, operation: "create" | "update") => Promise; export declare const beforeEntityRead: (entityName: string, query: Record, userId?: string) => Promise>; export declare const afterEntityRead: (entityName: string, results: T[], query: Record, userId?: string) => Promise; //# sourceMappingURL=entity-hooks.d.ts.map