From 1bf99eca9c356fc41f520491d96963438a18ce00 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 20 May 2020 23:27:36 -0700 Subject: Add new types for casting credential responses --- packages/typescript-types/src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'packages/typescript-types/src') diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 71e888b..4411fec 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -55,6 +55,20 @@ export type AssertionCredentialsJSON = { }, }; +/** + * The value returned from navigator.credentials.create() + */ +export interface AttestationCredential extends PublicKeyCredential { + response: AuthenticatorAttestationResponse; +} + +/** + * The value returned from navigator.credentials.get() + */ +export interface AssertionCredential extends PublicKeyCredential { + response: AuthenticatorAssertionResponse; +} + /** * A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that * are base64-encoded in the browser so that they can be sent as JSON to the server. -- cgit v1.2.3