import { type RegisterSourceEventV2, type TriggerMetadata } from "@systemfsoftware/trigger.dev_core-v2"; import { Job } from "../job.js"; import { TriggerClient } from "../triggerClient.js"; import type { EventSpecification, Trigger } from "../types.js"; import { ExternalSource, type ExternalSourceParams } from "./externalSource.js"; import type { EventFilter } from "@systemfsoftware/trigger.dev_core-v2"; /** Options for a DynamicTrigger */ export type DynamicTriggerOptions, TExternalSource extends ExternalSource> = { /** Used to uniquely identify a DynamicTrigger */ id: string; /** An event from an [Integration](https://trigger.dev/docs/integrations) package that you want to attach to the DynamicTrigger. The event types will come through to the payload in your Job's run. */ event: TEventSpec; /** An external source fron an [Integration](https://trigger.dev/docs/integrations) package * @example * ```ts * import { events } from "@systemfsoftware/trigger.dev_github"; * * const dynamicOnIssueOpened = client.defineDynamicTrigger({ id: "github-issue-opened", event: events.onIssueOpened, source: github.sources.repo, }); * ``` */ source: TExternalSource; }; /** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime. */ export declare class DynamicTrigger, TExternalSource extends ExternalSource> implements Trigger { #private; source: TExternalSource; /** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime. * @param client The `TriggerClient` instance to use for registering the trigger. * @param options The options for the dynamic trigger. * */ constructor(client: TriggerClient, options: DynamicTriggerOptions); toJSON(): TriggerMetadata; get id(): string; get event(): TEventSpec; /** Use this method to register a new configuration with the DynamicTrigger. * @param key The key for the configuration. This will be used to identify the configuration when it is triggered. * @param params The params for the configuration. * @param options Options for the configuration. * @param options.accountId The accountId to associate with the configuration. * @param options.filter The filter to use for the configuration. * */ register(key: string, params: ExternalSourceParams, options?: { accountId?: string; filter?: EventFilter; }): Promise; attachToJob(triggerClient: TriggerClient, job: Job, any>): void; get preprocessRuns(): boolean; verifyPayload(payload: ReturnType): Promise<{ success: true; }>; } //# sourceMappingURL=dynamic.d.ts.map