Skip to main content

InferActions

@rotorsoft/act-root


@rotorsoft/act-root / act/src / InferActions

Type Alias: InferActions<T>

InferActions<T> = { [K in keyof T["actions"]]: T["actions"][K] extends ZodType<infer V> ? V : never }

Defined in: libs/act/src/types/action.ts:373

Extracts the raw action schemas from a State definition.

Use this to recover the TActions type parameter from a built State object, enabling construction of typed dispatchers without circular imports.

Type Parameters

T

T extends object

A State object (or any object with readonly actions: ZodTypes<TActions>)

Example

type Actions = InferActions<typeof Counter>;
// => { increment: { by: number } }