Skip to content

Commit

Permalink
docs(types): add comments for Workflow methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rifont committed Nov 7, 2024
1 parent aeae66d commit b351651
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/framework/src/types/discover.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,20 @@ export type DiscoverWorkflowOutput = {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Workflow<T_Payload = any> = {
/**
* Trigger an event for this workflow with a strongly typed and validated `payload`, derived from the `payloadSchema`.
*
* @param event - The event to trigger
* @returns `EventTriggerResult` - The result of the event trigger
*/
trigger: (
event: Prettify<Omit<EventTriggerParams<T_Payload>, 'workflowId' | 'bridgeUrl' | 'controls'>>
) => Promise<EventTriggerResult>;
/**
* Discover the workflow definition.
*
* @returns `DiscoverWorkflowOutput` - The workflow definition
*/
discover: () => Promise<DiscoverWorkflowOutput>;
};

Expand Down

0 comments on commit b351651

Please sign in to comment.