I'm trying to create a Typescript class that has unknown property names with known values as well as methods. I don't have any problem with the unknown property names but when I try to add a method I get an error: "Property 'update' of type '() => void' is not assignable to 'string' index type 'Quote'."
EDIT: adding data info Data would look like (I know the symbol is redundant but it just has to be that way):
{
'TQQQ': {
symbol: 'TQQQ',
lastPrice: 50
}
}
interface Quote {...}
class Watchlist {
[key: string]: Quote
update() {...}
}
Here's a playground
update? Then it'd be a function, not aQuote.