summaryrefslogtreecommitdiffhomepage
path: root/packages/typescript-types
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-12-10 22:40:45 -0800
committerGitHub <noreply@github.com>2022-12-10 22:40:45 -0800
commit461b67c0c6fadfb55c1da6c9c8ab2693ba4c9a03 (patch)
treeae713d608966ac977390e7bbfbeab5ea79a191bc /packages/typescript-types
parent33528afe001d4aca62052dce204c0398c3127ffd (diff)
parent90dd7f247182329987a8e23f476d9280d8d5c265 (diff)
Merge pull request #299 from MasterKale/feat/isomorphic
feat/isomorphic
Diffstat (limited to 'packages/typescript-types')
-rw-r--r--packages/typescript-types/extract-dom-types.ts1
-rw-r--r--packages/typescript-types/src/index.ts23
2 files changed, 13 insertions, 11 deletions
diff --git a/packages/typescript-types/extract-dom-types.ts b/packages/typescript-types/extract-dom-types.ts
index 856cb63..36072e6 100644
--- a/packages/typescript-types/extract-dom-types.ts
+++ b/packages/typescript-types/extract-dom-types.ts
@@ -25,6 +25,7 @@ const types = [
'AuthenticationExtensionsClientOutputs',
'AuthenticatorSelectionCriteria',
'COSEAlgorithmIdentifier',
+ 'Crypto',
'PublicKeyCredential',
'PublicKeyCredentialCreationOptions',
'PublicKeyCredentialDescriptor',
diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts
index 7513555..3bb93ba 100644
--- a/packages/typescript-types/src/index.ts
+++ b/packages/typescript-types/src/index.ts
@@ -6,7 +6,6 @@
import type {
AuthenticatorAssertionResponse,
AuthenticatorAttestationResponse,
- COSEAlgorithmIdentifier,
PublicKeyCredential,
PublicKeyCredentialCreationOptions,
PublicKeyCredentialDescriptor,
@@ -14,7 +13,6 @@ import type {
PublicKeyCredentialUserEntity,
AuthenticationExtensionsClientInputs,
AuthenticationExtensionsClientOutputs,
- AuthenticatorAttachment,
} from './dom';
export * from './dom';
@@ -95,7 +93,15 @@ export interface AuthenticationCredentialJSON
* are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
*/
export interface AuthenticatorAttestationResponseJSON
- extends Omit<AuthenticatorAttestationResponseFuture, 'clientDataJSON' | 'attestationObject'> {
+ extends Omit<
+ AuthenticatorAttestationResponseFuture,
+ | 'clientDataJSON'
+ | 'attestationObject'
+ | 'getTransports'
+ | 'getAuthenticatorData'
+ | 'getPublicKey'
+ | 'getPublicKeyAlgorithm'
+ > {
clientDataJSON: Base64URLString;
attestationObject: Base64URLString;
}
@@ -119,8 +125,8 @@ export interface AuthenticatorAssertionResponseJSON
* A WebAuthn-compatible device and the information needed to verify assertions by it
*/
export type AuthenticatorDevice = {
- credentialPublicKey: Buffer;
- credentialID: Buffer;
+ credentialPublicKey: Uint8Array;
+ credentialID: Uint8Array;
// Number of times this authenticator is expected to have been used
counter: number;
// From browser's `startRegistration()` -> RegistrationCredentialJSON.transports (API L2 and up)
@@ -142,10 +148,7 @@ export type Base64URLString = string;
* Properties marked optional are not supported in all browsers.
*/
export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAttestationResponse {
- getTransports?: () => AuthenticatorTransportFuture[];
- getAuthenticatorData?: () => ArrayBuffer;
- getPublicKey?: () => ArrayBuffer;
- getPublicKeyAlgorithm?: () => COSEAlgorithmIdentifier[];
+ getTransports: () => AuthenticatorTransportFuture[];
}
/**
@@ -171,8 +174,6 @@ export interface PublicKeyCredentialDescriptorFuture
export interface PublicKeyCredentialFuture extends PublicKeyCredential {
// See https://github.com/w3c/webauthn/issues/1745
isConditionalMediationAvailable?(): Promise<boolean>;
- // See https://w3c.github.io/webauthn/#dom-publickeycredential-authenticatorattachment
- authenticatorAttachment?: AuthenticatorAttachment;
}
/**