Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mutable.d.ts 860B

12345678910111213141516171819202122
  1. /**
  2. Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly<T>`.
  3. This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509).
  4. @example
  5. ```
  6. import {Mutable} from 'type-fest';
  7. type Foo = {
  8. readonly a: number;
  9. readonly b: string;
  10. };
  11. const mutableFoo: Mutable<Foo> = {a: 1, b: '2'};
  12. mutableFoo.a = 3;
  13. ```
  14. */
  15. export type Mutable<ObjectType> = {
  16. // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key.
  17. -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType];
  18. };