Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 551 Bytes

readonly-x.md

File metadata and controls

25 lines (18 loc) · 551 Bytes
category alias
X Series
ReadonlyByKeys

ReadonlyX

Constructs a type by setting the properties specified by K(string literal or union of string literals) to readonly from T.

Usage

import type { ReadonlyX } from '@utype/core'

type Props = {
  name: string;
  age: number;
  visible: boolean;
}

// Expect: { readonly name: string; readonly age: number; visible: boolean; } // [!code highlight]
type ReadonlyXProps = ReadonlyX<Props, 'name' | 'age'>