Closed peterwiebe closed 2 years ago
name
shouldn't be there https://github.com/jakearchibald/idb#typescript.
Can you show me the type of object you're wanting to store, and what its key is?
Maybe you mean this?
interface MyDBFixed extends DBSchema {
items: {
key: string;
value: { name: string };
};
}
My apologies, you are correct. I think I was rushing to try and grok the API and overlooked the format required for the type definition. Thank you for responding 🙏
I am just starting to use idb and am trying to follow the example in the Readme but I seem to be having a Typescript issue with the schema definition as defined:
I get the following error message:
Property 'items' of type '{ key: string; name: string; }' is not assignable to 'string' index type 'DBSchemaValue'.
dependencies: "idb": "^7.0.2", "typescript": "~4.5.2"