Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 112d405

Browse files
committed
Modify the upstream TypeScript types by marking authenticatorAttachment as optional on PublicKeyCredential for now.
This means that a `PublicKeyCredentialWithClientExtensionResults` is no longer a subtype of the version of `PublicKeyCredential` in the latest version of TypeScript, but `webauthn-json` will be forwards and backwards compatible with TypeScript (i.e. without compilation errors) for now. See: - Typescript 4.9.4: Types of property 'authenticatorAttachment' are incompatible #73 (comment) - `authenticatorAttachment` field on `PublicKeyCredential` is incompatible with Firefox microsoft/TypeScript-DOM-lib-generator#1477
1 parent 84d20bf commit 112d405

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"jest-environment-jsdom": "^29.2.2",
3939
"rome": "^10.0.1",
4040
"ts-jest": "^29.0.3",
41-
"typescript": "^4.8.4"
41+
"typescript": "^4.9.4"
4242
},
4343
"scripts": {
4444
"build": "npm run build-js && npm run build-types",

src/webauthn-json/basic/json.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ interface AuthenticationExtensionsClientOutputsJSON
1313
credProps?: CredPropsAuthenticationExtensionsClientOutputsJSON;
1414
}
1515

16+
type PublicKeyCredentialWithOptionalAuthenticatorAttachment =
17+
Partial<PublicKeyCredential> &
18+
Omit<PublicKeyCredential, "authenticatorAttachment">;
19+
1620
export interface PublicKeyCredentialWithClientExtensionResults
17-
extends PublicKeyCredential {
21+
extends PublicKeyCredentialWithOptionalAuthenticatorAttachment {
1822
authenticatorAttachment?: string | null;
1923
clientExtensionResults?: AuthenticationExtensionsClientOutputsJSON;
2024
}

0 commit comments

Comments
 (0)