Home > types-kit > SetMutable
Make some properties in T mutable (remove readonly decorator).
Signature:
export type SetMutable<T, K extends Keys<T>> = Simplify<
StrictOmit<T, K> & Mutable<Pick<T, K>>
>References: Keys, Simplify, StrictOmit, Mutable
interface Props {
readonly a: number;
readonly b: number;
readonly c: number;
};
// Expect: { a: number; b: number; readonly c: number; }
type NewProps = SetMutable<Props, 'a' | 'b'>;