Extend types accepted by DatasetContext to include (SolidDataset & WithAcp)
This commit allows the DatasetContext component to be used with (SolidDataset & WithAcp)
Checklist
- [x] All acceptance criteria are met.
- [n/a] Relevant documentation, if any, has been written/updated.
- [x] The changelog has been updated, if applicable.
- [n/a] New functions/types have been exported in
index.ts, if applicable. - [x] Commits in this PR are minimal and have descriptive commit messages.
Right now, the DatasetContext component will accept a (SolidDataset & WithACP) but will only return a SolidDataset, which means that I'm not able to use any of the acp functions on the dataset I've kept in context. I was looking to make the component return the(SolidDataset & WithAcp) if that was passed to it to solve that issue
@ABhat00 Ah I see - that requires using a generic to link the input type to the output type. See for example how we've done that for setThing, whose output SolidDataset has the same type as the input, with the addition of WithChangeLog. (There, Dataset is the generic.)
Also note that your import statement imports from the dist folder, rather than directly from @inrupt/solid-client. Although Webpack 4 and below allow just reaching into a package and importing from whatever file is available there, this will break once this library migrates to Webpack 5.