From ff9f18de99d36d3f7a993c9e2b10f2dabe60aafb Mon Sep 17 00:00:00 2001 From: vinassefranche Date: Wed, 10 Sep 2025 20:40:58 +0200 Subject: [PATCH 1/2] Add changeset --- .changeset/afraid-phones-love.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/afraid-phones-love.md diff --git a/.changeset/afraid-phones-love.md b/.changeset/afraid-phones-love.md new file mode 100644 index 00000000000..9a2ac388872 --- /dev/null +++ b/.changeset/afraid-phones-love.md @@ -0,0 +1,5 @@ +--- +"@effect/workflow": patch +--- + +Add Workflow type utils From 929c6ecbd2d5211e07b56a180ce0152a2baf97ba Mon Sep 17 00:00:00 2001 From: vinassefranche Date: Wed, 10 Sep 2025 20:43:55 +0200 Subject: [PATCH 2/2] Add Workflow type namespace to add type utils --- packages/workflow/src/Workflow.ts | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index b57cca09dd7..ea21fdcaa2a 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -25,6 +25,41 @@ import type { WorkflowEngine, WorkflowInstance } from "./WorkflowEngine.js" */ export const TypeId: unique symbol = Symbol.for("@effect/workflow/Workflow") +/** + * @since 1.0.0 + */ +export declare namespace Workflow { + /** + * Extracts the type of the Payload of a `Workflow`. + * + * @since 1.0.0 + * @category Type-level Utils + */ + export type Payload> = W extends Workflow + ? Payload["Type"] + : never + + /** + * Extracts the type of the Success of a `Workflow`. + * + * @since 1.0.0 + * @category Type-level Utils + */ + export type Success> = W extends Workflow + ? Success["Type"] + : never + + /** + * Extracts the type of the Error of a `Workflow`. + * + * @since 1.0.0 + * @category Type-level Utils + */ + export type Error> = W extends Workflow + ? Error["Type"] + : never +} + /** * @since 1.0.0 * @category Symbols