How define a typescript interface for a object that uses attributes as a list
0
I'm working in a TypeScript frontend service for a closed API. There is a POST method in this API that expects something like this: { transactionId:10, price:123.12, item1:"some string", item2:"another string", item3:"another string", item4:"another string", item5:"another string", // ... until the Nth item(n) ... } In other words. It expects that items should be defined as "item" + index , instead of using a simple array. How can I define this interface on typescript that can fit a object like this?
typescript
share | improve this question
edited No...