diff options
author | Matthew Miller <matthew@millerti.me> | 2022-12-27 19:18:06 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-12-27 19:18:06 -0800 |
commit | 9368677134917f9c4fc9b3d82fd94050354d7fd1 (patch) | |
tree | 71f4c8bfe900f6c734b646ceaa1b131c0db08a91 /packages/typescript-types | |
parent | d821ec1f64463f135cd5e15dfd8bdd170bf91730 (diff) |
Add new methods to PublicKeyCredentialFuture
Diffstat (limited to 'packages/typescript-types')
-rw-r--r-- | packages/typescript-types/src/index.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 43e2f5b..c6562a0 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -195,11 +195,23 @@ export interface PublicKeyCredentialDescriptorFuture } /** - * A super class of TypeScript's `PublicKeyCredential` that knows about upcoming WebAuthn methods + * + */ +export type PublicKeyCredentialJSON = RegistrationResponseJSON | AuthenticationResponseJSON; + +/** + * A super class of TypeScript's `PublicKeyCredential` that knows about upcoming WebAuthn features */ export interface PublicKeyCredentialFuture extends PublicKeyCredential { + type: PublicKeyCredentialType; // See https://github.com/w3c/webauthn/issues/1745 isConditionalMediationAvailable?(): Promise<boolean>; + // See https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON + parseCreationOptionsFromJSON?(options: PublicKeyCredentialCreationOptionsJSON): PublicKeyCredentialCreationOptions; + // See https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON + parseRequestOptionsFromJSON?(options: PublicKeyCredentialRequestOptionsJSON): PublicKeyCredentialRequestOptions; + // See https://w3c.github.io/webauthn/#dom-publickeycredential-tojson + toJSON?(): PublicKeyCredentialJSON; } /** |