Extracts the property map of a type: an object type with the same keys and value types as T, preserving optional and readonly modifiers.
T
{ [k in keyof T]: T[k] }
any
unknown
() => void
{}
Function
The type whose properties to extract.
type T = { a: number; b?: string }type R = Properties<T> // { a: number; b?: string }type Merged = Properties<{ a: 1 } & { b: 2 }> // { a: 1; b: 2 } Copy
type T = { a: number; b?: string }type R = Properties<T> // { a: number; b?: string }type Merged = Properties<{ a: 1 } & { b: 2 }> // { a: 1; b: 2 }
Extracts the property map of a type: an object type with the same keys and value types as
T, preserving optional and readonly modifiers.{ [k in keyof T]: T[k] }.anyandunknown: returns the input type unchanged.() => void): returns{}because call signatures are not indexable; forFunction, returns the interface of methods.