import { type EventFilter, type TriggerMetadata } from "@systemfsoftware/trigger.dev_core-v2"; import { Job } from "../job.js"; import { TriggerClient } from "../triggerClient.js"; import { type EventSpecification, type EventSpecificationExample, type EventTypeFromSpecification, type SchemaParser, type Trigger } from "../types.js"; import type { VerifyCallback } from "../httpEndpoint.js"; type EventTriggerOptions> = { event: TEventSpecification; name?: string | string[]; source?: string; filter?: EventFilter; verify?: EventTypeFromSpecification extends Request ? VerifyCallback : never; }; export declare class EventTrigger> implements Trigger { #private; constructor(options: EventTriggerOptions); toJSON(): TriggerMetadata; get event(): TEventSpecification; attachToJob(triggerClient: TriggerClient, job: Job, any>): void; get preprocessRuns(): boolean; verifyPayload(payload: ReturnType): Promise; } /** Configuration options for an EventTrigger */ type TriggerOptions = { /** The name of the event you are subscribing to. Must be an exact match (case sensitive). To trigger on multiple possible events, pass in an array of event names */ name: string | string[]; /** A [Zod](https://trigger.dev/docs/documentation/guides/zod) schema that defines the shape of the event payload. * The default is `z.any()` which is `any`. * */ schema?: SchemaParser; /** You can use this to filter events based on the source. */ source?: string; /** Used to filter which events trigger the Job * @example * filter: * ```ts * { * name: ["John", "Jane"], * age: [18, 21] * } * ``` * * This filter would match against an event with the following data: * ```json * { * "name": "Jane", * "age": 18, * "location": "San Francisco" * } * ``` */ filter?: EventFilter; examples?: EventSpecificationExample[]; }; /** `eventTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to subscribe to an event a Job from [a sent event](https://trigger.dev/docs/sdk/triggerclient/instancemethods/sendevent) * @param options options for the EventTrigger */ export declare function eventTrigger(options: TriggerOptions): Trigger>; export {}; //# sourceMappingURL=eventTrigger.d.ts.map