effect-io-ai

Package: effect
Module: Record

Record.ReadonlyRecord

Represents a readonly record with keys of type K and values of type A. This is the foundational type for immutable key-value mappings in Effect.

Example (Defining a readonly record type)

import type { Record } from "effect"

// Creating a readonly record type
type UserRecord = Record.ReadonlyRecord<"name" | "age", string | number>

const user: UserRecord = {
  name: "John",
  age: 30
}

Signature

type ReadonlyRecord<K, A> = {
  readonly [P in K]: A
}

Source

Since v2.0.0