LayerUnify<A>Type-level hook that allows Layer values to participate in Unify
inference.
Details
This is used by Effect's pipe and unification machinery to preserve the
provided services, error, and requirements of a Layer.
export interface interface LayerUnify<A extends { [Unify.typeSymbol]?: any; }>Type-level hook that allows Layer values to participate in Unify
inference.
Details
This is used by Effect's pipe and unification machinery to preserve the
provided services, error, and requirements of a Layer.
LayerUnify<function (type parameter) A in LayerUnify<A extends { [Unify.typeSymbol]?: any; }>A extends { [import UnifyUnify.const typeSymbol: typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol]?: any }> {
LayerUnify<A extends { [Unify.typeSymbol]?: any; }>.Layer?: () => A[Unify.typeSymbol] extends Layer<any, any, any> | infer _ ? Layer<Success<Extract<A[Unify.typeSymbol], Any>>, Error<Extract<A[Unify.typeSymbol], Any>>, Services<Extract<A[Unify.typeSymbol], Any>>> : neverLayer?: () => function (type parameter) A in LayerUnify<A extends { [Unify.typeSymbol]?: any; }>A[import UnifyUnify.type typeSymbol = typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol] extends interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<any, any, any> | infer function (type parameter) __ ? interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<
type Success<T extends Any> =
T extends Layer<
infer _ROut,
infer _E,
infer _RIn
>
? _ROut
: never
Extracts the service output type (ROut) from a Layer type.
When to use
Use to derive the services provided by an existing or generic Layer without
restating its ROut type parameter.
Success<type Extract<T, U> = T extends U
? T
: never
Extract from T those types that are assignable to U
Extract<function (type parameter) A in LayerUnify<A extends { [Unify.typeSymbol]?: any; }>A[import UnifyUnify.type typeSymbol = typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol], Any>>,
type Error<T extends Any> =
T extends Layer<
infer _ROut,
infer _E,
infer _RIn
>
? _E
: never
Extracts the error type (E) from a Layer type.
When to use
Use to derive a layer construction error type for helper types, wrappers, or
APIs that preserve a layer failure channel.
Error<type Extract<T, U> = T extends U
? T
: never
Extract from T those types that are assignable to U
Extract<function (type parameter) A in LayerUnify<A extends { [Unify.typeSymbol]?: any; }>A[import UnifyUnify.type typeSymbol = typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol], Any>>,
type Services<T extends Any> =
T extends infer L
? L extends Layer<
infer _ROut,
infer _E,
infer _RIn
>
? _RIn
: never
: never
Extracts the service requirements (RIn) from a Layer type.
When to use
Use to derive the dependency requirements of a generic or inferred Layer
without restating its RIn type parameter.
Services<type Extract<T, U> = T extends U
? T
: never
Extract from T those types that are assignable to U
Extract<function (type parameter) A in LayerUnify<A extends { [Unify.typeSymbol]?: any; }>A[import UnifyUnify.type typeSymbol = typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol], Any>>
>
: never
}