import type { ActionDefinition } from "./ActionDefinition"; import type { ActionInputParameters } from "./ActionInputParameters"; import type { ActionContext } from "./ActionPerformFunction"; import type { ActionPerformReturn } from "./ActionPerformReturn"; import type { ActionDisplayDefinition } from "./DisplayDefinition"; import type { ConfigVarResultCollection, Inputs } from "./Inputs"; import type { TriggerEventFunction } from "./TriggerEventFunction"; import type { TriggerPayload } from "./TriggerPayload"; import type { TriggerResult } from "./TriggerResult"; export interface PollingContext extends ActionContext { polling: { invokeAction: (params: ActionInputParameters) => Promise>; getState: () => Record; setState: (newState: Record) => void; }; } export type PollingTriggerPerformFunction = TriggerResult> = (context: ActionContext & PollingContext, payload: TPayload, params: ActionInputParameters) => Promise; /** * PollingTriggerDefinition is the type of the object that is passed in to `pollingTrigger` function to * define a component trigger. */ export interface PollingTriggerDefinition = TriggerResult, TActionInputs extends Inputs = Inputs, TAction extends ActionDefinition = ActionDefinition, TCombinedInputs extends TInputs & TActionInputs = TInputs & TActionInputs> { triggerType?: "polling"; /** Defines how the Action is displayed in the Prismatic interface. */ display: ActionDisplayDefinition; /** Defines your trigger's polling behavior. */ pollAction?: TAction; /** Function to perform when this Trigger is invoked. A default perform will be provided for most polling triggers but defining this allows for custom behavior. */ perform: PollingTriggerPerformFunction; /** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deployed. */ onInstanceDeploy?: TriggerEventFunction; /** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deleted. */ onInstanceDelete?: TriggerEventFunction; /** InputFields to present in the Prismatic interface for configuration of this Trigger. */ inputs?: TInputs; /** Determines whether this Trigger allows Conditional Branching. */ allowsBranching?: TAllowsBranching; /** An example of the payload outputted by this Trigger. */ examplePayload?: Awaited>; } export declare const isPollingTriggerDefinition: (ref: unknown) => ref is PollingTriggerDefinition;