import type { IntegrationTriggerType, TriggerConfig, TriggerEvent } from "@automate.ax/integration-contracts/triggers"; import type { IntegrationAccountRequirement, TriggerDefinition } from "@automate.ax/catalog/authoring"; import type { IntegrationAccountReference } from "./integrations.js"; import type { Signal } from "./signal-protocol.js"; type IntegrationTriggerDefinition = TriggerDefinition; /** Adds the SDK-owned account reference type without coupling contracts to it. */ type TriggerAccountOptions = TDefinition extends { readonly account: IntegrationAccountRequirement; } ? { /** Static project account binding selected for this trigger. */ account?: string | IntegrationAccountReference; } : object; /** Authoring options inferred from one catalog definition and shared contract. */ export type TriggerOptions = TriggerConfig & TriggerAccountOptions; /** Makes factory options optional only when the canonical config has no fields. */ type TriggerArguments = object extends TOptions ? [options?: TOptions] : [options: TOptions]; /** Typed trigger function produced from one catalog definition. */ export type TriggerFactory = (...args: TriggerArguments>) => Signal>; /** * Creates a public trigger function from its lightweight catalog definition. * * Event and canonical configuration types are resolved by the definition's * stable event type. Pass a mapper only when the public options intentionally * differ from the canonical subscription configuration. * * @param trigger - Client-safe trigger definition from the catalog. */ export declare function createTrigger(trigger: TDefinition): TriggerFactory; /** * Creates a public trigger function with an authoring-to-canonical config map. * * @param trigger - Client-safe trigger definition from the catalog. * @param getConfig - Converts public arguments into canonical configuration. */ export declare function createTrigger(trigger: TDefinition, getConfig: (...args: TArguments) => TriggerOptions): (...args: TArguments) => Signal>; export {}; //# sourceMappingURL=create-trigger.d.ts.map