UNPKG

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