类型修饰

readonly

type Writeable<T> = { -readonly [P in keyof T]-?: T[P] };

interface Foo {
    readonly bar: boolean;
}

let baz: Writeable<Foo>;

baz.bar = true;
上一页