diff options
author | Matthew Miller <matthew@millerti.me> | 2020-05-20 23:27:36 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-05-20 23:27:36 -0700 |
commit | 1bf99eca9c356fc41f520491d96963438a18ce00 (patch) | |
tree | 38f98f27e4b473d347059015cbd6b285bb3d1805 | |
parent | 4b5c9163395b2ba76a784ef51a81e7b1721bd595 (diff) |
Add new types for casting credential responses
-rw-r--r-- | packages/typescript-types/src/index.ts | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ -56,6 +56,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. */ |