/** * Hook runner functions for executing lifecycle hooks. * * Before-hooks chain: each hook receives the output of the previous one. * After-hooks and onChange run independently with errors swallowed. */ import { Effect } from "effect"; import type { HookError } from "../errors/crud-errors.js"; import type { UpdateWithOperators } from "../types/crud-types.js"; import type { AfterCreateContext, AfterCreateHook, AfterDeleteContext, AfterDeleteHook, AfterUpdateContext, AfterUpdateHook, BeforeCreateContext, BeforeCreateHook, BeforeDeleteContext, BeforeDeleteHook, BeforeUpdateContext, BeforeUpdateHook, OnChangeContext, OnChangeHook } from "../types/hook-types.js"; /** * Run beforeCreate hooks in order, chaining each hook's output to the next. * Returns the final transformed data, or fails with HookError if any hook rejects. * * If hooks array is empty or undefined, returns the initial data unchanged. */ export declare const runBeforeCreateHooks: (hooks: ReadonlyArray> | undefined, initialCtx: BeforeCreateContext) => Effect.Effect; /** * Run beforeUpdate hooks in order, chaining each hook's output to the next. * Returns the final transformed update payload, or fails with HookError if any hook rejects. * * If hooks array is empty or undefined, returns the initial update unchanged. */ export declare const runBeforeUpdateHooks: (hooks: ReadonlyArray> | undefined, initialCtx: BeforeUpdateContext) => Effect.Effect, HookError>; /** * Run beforeDelete hooks in order. Each hook receives the same context. * Returns void on success, or fails with HookError if any hook rejects. * * If hooks array is empty or undefined, returns void (no-op). */ export declare const runBeforeDeleteHooks: (hooks: ReadonlyArray> | undefined, ctx: BeforeDeleteContext) => Effect.Effect; /** * Run afterCreate hooks in order. Each hook receives the same context. * Errors are swallowed (fire-and-forget). * * If hooks array is empty or undefined, no-op. */ export declare const runAfterCreateHooks: (hooks: ReadonlyArray> | undefined, ctx: AfterCreateContext) => Effect.Effect; /** * Run afterUpdate hooks in order. Each hook receives the same context. * Errors are swallowed (fire-and-forget). * * If hooks array is empty or undefined, no-op. */ export declare const runAfterUpdateHooks: (hooks: ReadonlyArray> | undefined, ctx: AfterUpdateContext) => Effect.Effect; /** * Run afterDelete hooks in order. Each hook receives the same context. * Errors are swallowed (fire-and-forget). * * If hooks array is empty or undefined, no-op. */ export declare const runAfterDeleteHooks: (hooks: ReadonlyArray> | undefined, ctx: AfterDeleteContext) => Effect.Effect; /** * Run onChange hooks in order. Each hook receives the same context. * Errors are swallowed (fire-and-forget). * * If hooks array is empty or undefined, no-op. */ export declare const runOnChangeHooks: (hooks: ReadonlyArray> | undefined, ctx: OnChangeContext) => Effect.Effect; //# sourceMappingURL=hook-runner.d.ts.map