import { ChangeSetHandlerDefinition } from '../types/innerFunction'; import { ChangeSetDescriptor } from '../types/customFunction'; export type DefineChangeSetHandlerInput = { match: { name: string; }; handle?: ChangeSetHandlerDefinition['handle']; handleChanges?: ChangeSetHandlerDefinition['handleChanges']; handleAfter?: ChangeSetHandlerDefinition['handleAfter']; }; /** * Build a MEXWEX V2 changeset handler for `CustomFunctionParams.changeSetHandlers`. * * Validates the shape eagerly so a mis-declared handler fails at bundle import * time rather than at the first lambda invocation. Handlers match by * `match.name`, not entity type — two named handlers can target the same * GraphQL type with different logic. * * Exactly one of `handle` / `handleChanges` must be declared: * - `handle` runs once per change, before the backend's default mutation, * and reports whether it applied that change. * - `handleChanges` runs ONCE with the whole batch of changes routed to this * handler name, so the author can issue a single mutation and get one DB * transaction, and reports the outcome for every change in the batch. * `handleAfter` (optional, either way) runs after the backend resolved temp * uids and applied any default mutation. */ export declare const defineChangeSetHandler: (def: DefineChangeSetHandlerInput) => ChangeSetHandlerDefinition; /** * Validate a collection of changeset handler definitions (uniqueness of * `match.name`). Called by the dispatcher at lambda boot; also re-usable from a * build-time validator in the form bundle pipeline. */ export declare const validateChangeSetHandlerDefinitions: (handlers: ChangeSetHandlerDefinition[]) => void; /** * Extract the ChangeSetDescriptor list (name) from a `params.changeSetHandlers` * array, mirrored to `CustomFunctionFeatures.changeSets` so the backend can list * handler names without unpacking the lambda. */ export declare const toChangeSetDescriptors: (handlers: ChangeSetHandlerDefinition[]) => ChangeSetDescriptor[]; //# sourceMappingURL=defineChangeSetHandler.d.ts.map