github/webauthn-json

Compatibility with TypeScript 3.6

josh opened this issue · 2 comments

josh commented

Hey @lgarron, it looks like most of @types/webappsec-credential-management has now been upstreamed into TypeScript's own lib/lib.dom.d.ts. See microsoft/TypeScript@b963e1a.

Trying to use webauthn-json on TypeScript 3.6 leads to the following error:

node_modules/@types/webappsec-credential-management/index.d.ts(378,6): error TS2300: Duplicate identifier 'PublicKeyCredentialType'.
node_modules/@types/webappsec-credential-management/index.d.ts(383,6): error TS2300: Duplicate identifier 'UserVerificationRequirement'.
node_modules/@types/webappsec-credential-management/index.d.ts(394,5): error TS2717: Subsequent property declarations must have the same type.  Property 'extensions' must be of type 'AuthenticationExtensionsClientInputs | undefined', but here has type 'any'.
node_modules/@types/webappsec-credential-management/index.d.ts(401,5): error TS2687: All declarations of 'id' must have identical modifiers.
node_modules/@types/webappsec-credential-management/index.d.ts(401,5): error TS2717: Subsequent property declarations must have the same type.  Property 'id' must be of type 'string | undefined', but here has type 'string'.
node_modules/@types/webappsec-credential-management/index.d.ts(425,6): error TS2300: Duplicate identifier 'AuthenticatorTransport'.
node_modules/@types/webappsec-credential-management/index.d.ts(439,6): error TS2300: Duplicate identifier 'AuthenticatorAttachment'.
node_modules/@types/webappsec-credential-management/index.d.ts(453,6): error TS2300: Duplicate identifier 'AttestationConveyancePreference'.
node_modules/@types/webappsec-credential-management/index.d.ts(469,5): error TS2717: Subsequent property declarations must have the same type.  Property 'extensions' must be of type 'AuthenticationExtensionsClientInputs | undefined', but here has type 'any'.
node_modules/@types/webappsec-credential-management/index.d.ts(501,14): error TS2717: Subsequent property declarations must have the same type.  Property 'response' must be of type 'AuthenticatorResponse', but here has type 'AuthenticatorAssertionResponse | AuthenticatorAttestationResponse'.
node_modules/typescript/lib/lib.dom.d.ts(1125,5): error TS2687: All declarations of 'id' must have identical modifiers.
node_modules/typescript/lib/lib.dom.d.ts(11992,11): error TS2320: Interface 'PublicKeyCredential' cannot simultaneously extend types 'Credential' and 'CredentialData'.
  Named property 'id' of types 'Credential' and 'CredentialData' are not identical.
node_modules/typescript/lib/lib.dom.d.ts(19991,6): error TS2300: Duplicate identifier 'AttestationConveyancePreference'.
node_modules/typescript/lib/lib.dom.d.ts(19994,6): error TS2300: Duplicate identifier 'AuthenticatorAttachment'.
node_modules/typescript/lib/lib.dom.d.ts(19995,6): error TS2300: Duplicate identifier 'AuthenticatorTransport'.
node_modules/typescript/lib/lib.dom.d.ts(20060,6): error TS2300: Duplicate identifier 'PublicKeyCredentialType'.
node_modules/typescript/lib/lib.dom.d.ts(20116,6): error TS2300: Duplicate identifier 'UserVerificationRequirement'.

I wonder how we best resolve this? Should we just remove the dependency for @types/webappsec-credential-management?

CC: @web-systems

woo, I'm excited for the TypeScript 3.6 release! It would have made my life significantly easier while working on this.

Do you know the best way to specify that a release of this library requires TypeScript 3.6?
(peerDependencies is presumably not right, because projects using this might not use TypeScript.)

Please let me know if version 0.3.6 fixes this!