// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/webauthn/#typedefdef-publickeycredentialclientcapabilities
typedef record<DOMString, boolean> PublicKeyCredentialClientCapabilities;
// https://w3c.github.io/webauthn/#publickeycredential
[
RuntimeEnabled=WebAuth,
SecureContext,
Exposed=Window
] interface PublicKeyCredential : Credential {
[SameObject] readonly attribute ArrayBuffer rawId;
[SameObject] readonly attribute AuthenticatorResponse response;
[SameObject] readonly attribute DOMString? authenticatorAttachment;
[CallWith=ScriptState] static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable();
[RuntimeEnabled=WebAuthenticationClientCapabilities, CallWith=ScriptState] static Promise<PublicKeyCredentialClientCapabilities> getClientCapabilities();
AuthenticationExtensionsClientOutputs getClientExtensionResults();
[CallWith=ScriptState] static Promise<boolean> isConditionalMediationAvailable();
[RuntimeEnabled=WebAuthenticationJSONSerialization, CallWith=ScriptState] PublicKeyCredentialJSON toJSON();
[RuntimeEnabled=WebAuthenticationJSONSerialization, CallWith=ScriptState, RaisesException] static PublicKeyCredentialCreationOptions parseCreationOptionsFromJSON(PublicKeyCredentialCreationOptionsJSON options);
[RuntimeEnabled=WebAuthenticationJSONSerialization, CallWith=ScriptState, RaisesException] static PublicKeyCredentialRequestOptions parseRequestOptionsFromJSON(PublicKeyCredentialRequestOptionsJSON options);
[CallWith=ScriptState, RaisesException, RuntimeEnabled=CredentialManagerReport] static Promise<undefined> signalUnknownCredential(UnknownCredentialOptions options);
[CallWith=ScriptState, RaisesException, RuntimeEnabled=CredentialManagerReport] static Promise<undefined> signalAllAcceptedCredentials(AllAcceptedCredentialsOptions options);
[CallWith=ScriptState, RaisesException, RuntimeEnabled=CredentialManagerReport] static Promise<undefined> signalCurrentUserDetails(CurrentUserDetailsOptions options);
};