Package: effect
Module: Context
Extracts the service implementation type stored behind a Context service
key.
Example (Extracting a service shape)
import { Context } from "effect"
const Database = Context.Service<{ query: (sql: string) => string }>(
"Database"
)
// Extract the service shape from the service
type DatabaseService = Context.Service.Shape<typeof Database>
// DatabaseService is { query: (sql: string) => string }
Signature
type Shape<T> = T extends Key<infer _I, infer S> ? S : never
Since v4.0.0