I have an object foo
interface Foo {
fooId: string;
otherStuff: any;
}
Now I have an object fooCollection, which is an object containing an undefined number of foos. Each property is a string equals to fooId. How could I define an accurate interface for fooCollection?
So far I came up with this:
interface FooCollection {
[key: string]: Foo;
}
-How could I tell ts that the number of property could be anything?
-Can I be more precise about the prop name, saying that it's fooId instead of any string?