typescript valueof object code example
Example 1: typescript valueof interface
type ValueOf<T> = T[keyof T];
Example 2: typescript type of object values
const data = {
value: 123,
text: 'text'
};
type Data = typeof data;
type ValueOf<T> = T[keyof T];
const data = {
value: 123,
text: 'text'
};
type Data = typeof data;