ContextValue

View Source

Summary

Resolves the value type associated with a request-context key.

Signature

type ContextValue<key> =
  key extends ContextKey<infer value>
    ? value
    : key extends (args: any[]) => infer instance
      ? instance
      : never;