import { GenericDataModel, GenericMutationCtx, TableNamesInDataModel } from "convex/server"; import { Change, Trigger, Triggers } from "convex-helpers/server/triggers"; //#region src/triggers.d.ts /** * One application-wide mutation interceptor registry. Pass it to * createAuthFunctions({ triggers }) so every authMutation/roleMutation/ * systemMutation runs writes through it — trigger enforcement becomes * structural, not a convention. */ export declare function createTriggers(): Triggers; /** Customize zCustomMutation/customMutation with this component's trigger registry. */ export declare function triggerContext(triggers: Triggers): import("convex-helpers/server/customFunctions").Customization, Record, { db: import("convex/server").GenericDatabaseWriter; }, Record, Record>; /** * Marks tables as append-only evidence tables: inserts pass, every update or * delete throws. The ontology pattern for votes/history/audit-style tables. */ export declare function appendOnly(triggers: Triggers, ...tables: readonly TableNamesInDataModel[]): void; /** Forbids hard deletes on the given tables (soft-delete discipline). */ export declare function noDelete(triggers: Triggers, ...tables: readonly TableNamesInDataModel[]): void; /** * Post-image tenant invariant for tenantTable rows. Row-level security * authorizes a modification against the PRE-image, so ownership must also be * enforced against the post-image: inserts must carry a tenant, and updates * may never reassign it. Register for every tenant table (same registry that * drives createTenantRules). */ export declare function tenantOwnership(triggers: Triggers, ...tables: readonly TableNamesInDataModel[]): void; /** * Maintains zod-table's opinionated lifecycle timestamps: createdAt and * updatedAt on insert, updatedAt on every update. archivedAt stays under * application control. Register once per table; writes made through the * auth constructors keep these fields correct automatically. */ export declare function timestamps(triggers: Triggers, ...tables: readonly TableNamesInDataModel[]): void; //#endregion export { type Change, type Trigger, Triggers }; //# sourceMappingURL=triggers.d.mts.map