import type { DefinitionQueueBridgeConfig } from '../core/types/DefinitionQueueBridgeConfig.js'; import type { QueueDefinition } from '../core/types/queue/QueueDefinition.js'; import type { QueueLifecycleConfig } from '../core/types/queue/QueueLifecycleConfig.js'; import type { QueueResultPolicy } from '../core/types/queue/QueueResultPolicy.js'; import type { QueueTransformHook } from '../core/types/queue/QueueTransformHook.js'; import type { AnyQueueWorkerDefinition } from '../core/types/queue/QueueWorkerDefinitionList.js'; import type { ScheduleOptions } from '../core/types/schedule/index.js'; import type { Schema } from '../schema/index.js'; /** * Builds a durable queue contract for background work. * * Queue definitions describe schemas, retry/lease behavior, result side * effects, worker bindings, and optional schedules. Runtime queue semantics are * provided by the configured queue bridge. * * @example * ```ts * const queue = service * .getQueueBuilder('billing.monthlyClosing', 'Close monthly billing') * .addPayloadSchema(monthlyClosingSchema) * .setLifecycleConfig({ maxAttempts: 5 }) * .emitResultAsEvent('billing.monthlyClosing.completed') * ``` */ export declare class QueueDefinitionBuilder { private readonly queueName; private readonly queueDescription; private payloadSchema?; private parameterSchema?; private lifecycleConfig?; private executionProfile?; private resultPolicy?; private schedules; private beforeEnqueueTransform?; private beforeExecuteTransform?; private tags; private deprecated; private workers; private deadLetter?; private queueBridgeConfig; constructor(queueName: string, queueDescription: string); /** Add the queue job payload schema used during enqueue and worker execution. */ addPayloadSchema(schema: Schema): this; /** Add the queue job parameter schema used during enqueue and worker execution. */ addParameterSchema(schema: Schema): this; /** Override queue retry, lease, heartbeat, delay, and retention lifecycle defaults. */ setLifecycleConfig(config: Partial): this; /** * Apply the built-in long-running queue execution profile. * * @example * ```ts * queue.setExecutionProfile('longRunning', { * maxRuntimeMs: 6 * 60 * 60_000, * }) * ``` */ setExecutionProfile(profile: 'longRunning', options: { maxRuntimeMs: number; strict?: boolean; }): this; /** * Persist or emit queue worker completion metadata. * * @example * ```ts * queue.setResultPolicy({ * mode: 'event', * successEventName: 'billing.monthlyClosing.completed', * }) * ``` */ setResultPolicy(policy: QueueResultPolicy): this; /** * Convenience helper for emitting successful worker output as a PURISTA event. */ emitResultAsEvent(successEventName: string, options?: Omit): this; /** * Mark this queue as a direct schedule target. */ markSchedulable(options: ScheduleOptions & { name: string; description?: string; }): this; /** * Transform or normalize a job before it is sent to the queue bridge. * * @example * ```ts * queue.setBeforeEnqueueTransform(async job => ({ * ...job, * parameter: { ...job.parameter, requestedAt: Date.now() }, * })) * ``` */ setBeforeEnqueueTransform(transform: QueueTransformHook): this; /** Transform or enrich a stored job immediately before worker execution. */ setBeforeExecuteTransform(transform: QueueTransformHook): this; /** Configure where failed jobs are dead-lettered when the queue bridge supports it. */ setDeadLetterOptions(options: { queueName?: string; }): this; /** Set tags used by tooling and generated queue metadata. */ setTags(tags: string[]): this; /** Mark this queue definition as deprecated in generated metadata. */ markAsDeprecated(): this; /** Configure queue bridge delivery hints such as prefetch and ordering guarantee. */ setQueueBridgeConfig(config: Partial): this; /** Attach one or more worker definitions that can process jobs from this queue. */ addWorkerDefinition(...workers: AnyQueueWorkerDefinition[]): this; /** Resolve this builder into the queue definition consumed by a service. */ getDefinition(): Promise; } //# sourceMappingURL=QueueDefinitionBuilder.impl.d.ts.map