effect-io-ai

Package: effect
Module: HashMap

HashMap.HashMap.Key

This type-level utility extracts the key type K from a HashMap<K, V> type.

Example

import { HashMap } from "effect"

declare const hm: HashMap.HashMap<string, number>

// $ExpectType string
type K = HashMap.HashMap.Key<typeof hm>

Signature

type Key<T> = [T] extends [HashMap<infer _K, infer _V>] ? _K : never

Source

Since v2.0.0