StoreEffectsOf<C>The object of effects produced by effects: the HandleOf structure (nested shape tree + custom methods) with Storage added to every method's requirement channel, carrying the StoreEffectsVariance brand.
export type type StoreEffectsOf<
C extends StoreContractValue
> = AddStorageReq<StoreHandleFromContract<C>> &
StoreEffectsVariance<C>
The object of effects produced by
effects
: the
HandleOf
structure (nested shape tree +
custom methods) with
Storage
added to every method's requirement channel, carrying the
StoreEffectsVariance
brand.
StoreEffectsOf<function (type parameter) C in type StoreEffectsOf<C extends StoreContractValue>C extends type StoreContractValue<Shapes extends StoreShapes = Readonly<Record<string, StoreShapeInput>>, Custom extends Readonly<Record<string, unknown>> = Readonly<Record<never, never>>> = StoreContractDef<Shapes, Custom> & PipeableStoreContractValue> = type AddStorageReq<T> = T extends (
...args: infer A
) => Effect.Effect<infer S, infer E, infer R>
? (
...args: A
) => Effect.Effect<S, E, R | Storage>
: T extends Effect.Effect<
infer S,
infer E,
infer R
>
? Effect.Effect<S, E, Storage | R>
: T extends Record<string, unknown>
? {
readonly [K in keyof T]: AddStorageReq<T[K]>
}
: T
Add
Storage
to the requirement channel of every method in a resolved-handle shape, recursing
into nested sub-trees. Mirrors the AsShape/tree recursion so it does not trip TS2589: a method
(...a) => Effect<S, E, R> → (...a) => Effect<S, E, R | Storage>; a bare
Effect
custom
member gains Storage too; a sub-tree recurses; anything else passes through.
AddStorageReq<type StoreHandleFromContract<C extends StoreContractValue> = { [K in keyof (Simplify<StoreShapeHandleTree<C["shapes"]>> & Simplify<{ readonly [K in CustomHandleKeys<C>]: CustomMethodOf<C, K>; }>)]: (Simplify<StoreShapeHandleTree<C["shapes"]>> & Simplify<{ readonly [K in CustomHandleKeys<C>]: CustomMethodOf<C, K>; }>)[K]; } extends infer B ? B : neverHandle materialized from a
StoreContractValue
— nested shape tree plus top-level custom methods.
StoreHandleFromContract<function (type parameter) C in type StoreEffectsOf<C extends StoreContractValue>C>> &
interface StoreEffectsVariance<out C extends StoreContractValue>Variance carrier for the
effects
brand — mirrors Effect's Stream.Variance. C is
covariant (Effect's (_: never) => C encoding), so a specific contract's effects satisfy the wide
StoreEffectsVariance<StoreContractValue> constraint that
mapEffects
/
catchWriteErrors
take.
StoreEffectsVariance<function (type parameter) C in type StoreEffectsOf<C extends StoreContractValue>C>;