Type Alias WritableProperties<T>

WritableProperties: Pick<T, WritablePropertyKeys<T>>

Projects T to an object containing only its writable properties.

Property value types and optional modifiers are preserved. Methods and writable function-valued properties are included.

Type Parameters

  • T extends object

    Object type to project.

interface Example
{
value: number;
optional?: boolean;
readonly id: string;
}

type Result = WritableProperties<Example>;

// {
// value: number;
// optional?: boolean;
// }