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.

22 lines
416B

  1. /**
  2. Create a type with the keys of the given type changed to `string` type.
  3. Use-case: Changing interface values to strings in order to use them in a form model.
  4. @example
  5. ```
  6. import {Stringified} from 'type-fest';
  7. type Car {
  8. model: string;
  9. speed: number;
  10. }
  11. const carForm: Stringified<Car> = {
  12. model: 'Foo',
  13. speed: '101'
  14. };
  15. ```
  16. */
  17. export type Stringified<ObjectType> = {[KeyType in keyof ObjectType]: string};