Closed
Description
I have encounter a few times in multiple applications an scenario in which I don't know the properties of an object but I do know that all its properties are of a certain type.
For example:
interface Metadata {
key: string,
value: any
}
var metadata = {
someReducer: Metadata ,
anotherReducer: Metadata ,
// ...
}
In this scenario:
- I don't know the property names or number of properties of
metadata
- I do know that
Metadata
is the type of all the properties ofmetadata
Now let's imagine that a function take the metadata object as argument:
function doSomething(metadata: any) {
// ...
}
I used any
as the type of the argument metadata but It would be great if I could let developers know that all the properties of this object must be of type Metadata
.
is there any way to create such type annotation?
Metadata
Metadata
Assignees
Labels
No labels