11import {
2- createExtendedRequestFromJSON as parseCreationOptionsFromJSON ,
3- createExtendedResponseToJSON ,
4- CredentialCreationOptionsExtendedJSON ,
5- CredentialRequestOptionsExtendedJSON ,
6- getExtendedRequestFromJSON as parseRequestOptionsFromJSON ,
7- getExtendedResponseToJSON ,
8- PublicKeyCredentialWithAssertionExtendedResultsJSON as AuthenticationResponseExtendedJSON ,
9- PublicKeyCredentialWithAttestationExtendedResultsJSON as RegistrationResponseExtendedJSON ,
10- supported ,
11- } from "./extended" ;
2+ createRequestFromJSON as parseCreationOptionsFromJSON ,
3+ createResponseToJSON ,
4+ getRequestFromJSON as parseRequestOptionsFromJSON ,
5+ getResponseToJSON ,
6+ } from "./basic/api" ;
7+ import { supported } from "./basic/supported" ;
8+
9+ import {
10+ CredentialCreationOptionsJSON ,
11+ CredentialRequestOptionsJSON ,
12+ PublicKeyCredentialWithAssertionJSON as AuthenticationResponseJSON ,
13+ PublicKeyCredentialWithAttestationJSON as RegistrationResponseJSON ,
14+ } from "./basic/json" ;
1215
1316export { parseCreationOptionsFromJSON , parseRequestOptionsFromJSON , supported } ;
1417export type {
15- CredentialCreationOptionsExtendedJSON ,
16- CredentialRequestOptionsExtendedJSON ,
17- AuthenticationResponseExtendedJSON ,
18- RegistrationResponseExtendedJSON ,
18+ CredentialCreationOptionsJSON ,
19+ CredentialRequestOptionsJSON ,
20+ AuthenticationResponseJSON ,
21+ RegistrationResponseJSON ,
1922} ;
2023
2124export interface RegistrationPublicKeyCredential extends PublicKeyCredential {
22- toJSON ( ) : RegistrationResponseExtendedJSON ;
25+ toJSON ( ) : RegistrationResponseJSON ;
2326}
2427
2528export async function create (
@@ -28,12 +31,12 @@ export async function create(
2831 const response = ( await navigator . credentials . create (
2932 options ,
3033 ) ) as RegistrationPublicKeyCredential ;
31- response . toJSON = ( ) => createExtendedResponseToJSON ( response ) ;
34+ response . toJSON = ( ) => createResponseToJSON ( response ) ;
3235 return response ;
3336}
3437
3538export interface AuthenticationPublicKeyCredential extends PublicKeyCredential {
36- toJSON ( ) : AuthenticationResponseExtendedJSON ;
39+ toJSON ( ) : AuthenticationResponseJSON ;
3740}
3841
3942export async function get (
@@ -42,6 +45,6 @@ export async function get(
4245 const response = ( await navigator . credentials . get (
4346 options ,
4447 ) ) as AuthenticationPublicKeyCredential ;
45- response . toJSON = ( ) => getExtendedResponseToJSON ( response ) ;
48+ response . toJSON = ( ) => getResponseToJSON ( response ) ;
4649 return response ;
4750}
0 commit comments