类型修饰
readonly
type Writeable<T> = { -readonly [P in keyof T]-?: T[P] };
interface Foo {
readonly bar: boolean;
}
let baz: Writeable<Foo>;
baz.bar = true;
type Writeable<T> = { -readonly [P in keyof T]-?: T[P] };
interface Foo {
readonly bar: boolean;
}
let baz: Writeable<Foo>;
baz.bar = true;