typescript create an object of type code example
Example 1: typescript type object
type Dictionary = {
[key: string]: any
}
Example 2: typescript type of object values
const data = {
value: 123,
text: 'text'
};
type Data = typeof data;
type Dictionary = {
[key: string]: any
}
const data = {
value: 123,
text: 'text'
};
type Data = typeof data;