summaryrefslogtreecommitdiffhomepage
path: root/packages/typescript-types
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-12-27 19:18:06 -0800
committerMatthew Miller <matthew@millerti.me>2022-12-27 19:18:06 -0800
commit9368677134917f9c4fc9b3d82fd94050354d7fd1 (patch)
tree71f4c8bfe900f6c734b646ceaa1b131c0db08a91 /packages/typescript-types
parentd821ec1f64463f135cd5e15dfd8bdd170bf91730 (diff)
Add new methods to PublicKeyCredentialFuture
Diffstat (limited to 'packages/typescript-types')
-rw-r--r--packages/typescript-types/src/index.ts14
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;
}
/**