inrupt/solid-client-access-grants-js

error in declaration files in the published NPM package

Closed this issue · 4 comments

Bug description

When installed from npm (tried with 3.0.1 and 3.0.2) and imported into a typescript project, the library causes the build to fail because the 'getConsent' function appears to be missing in the declaration files :

> tsc -b .

../../node_modules/@inrupt/solid-client-access-grants/dist/index.d.ts:15:169 - error TS2305: Module '"./common/getters"' has no exported member 'getConsent'.

15 export { AccessGrantWrapper, getAccessModes, getExpirationDate, getId, getIssuanceDate, getIssuer, getRequestor, getResourceOwner, getResources, getTypes, getPurposes, getConsent, getCredentialSubject, getInbox, getInherit, } from "./common/getters";
                                                                                                                                                                           ~~~~~~~~~~

Additional information

Looking at the dist files in the NPM package, that function is indeed required by index.d.ts, but missing from ./common/getters.d.ts . It is in the source TS file, though.

Maybe it's ommitted by the bundler because of the @internal flag on the function ?

Hi @pduchesne , thanks for reaching out! I'll look into this right ahead.

You are absolutely correct, our TSConfig has the stripInternal config option set to true, so there is no type declaration for things marked as @internal. I'll see whether it shouldn't be internal or should not be part of the exports, and release a fix soon.

The issue should be fixed with the latest v3.0.3 release of the library. If you confirm that this resolves the issue on your end, then this issue can be closed.

Yes it works.
Thank you.