// chrome/browser/ui/webui/ntp_microsoft_auth/ntp_microsoft_auth_shared_ui.mojom-webui.ts is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import { mojo } from '//resources/mojo/mojo/public/js/bindings.js';
export const AuthTypeSpec = { $: mojo.internal.Enum() };
export var AuthType;
(function (AuthType) {
    AuthType[AuthType["MIN_VALUE"] = 0] = "MIN_VALUE";
    AuthType[AuthType["MAX_VALUE"] = 1] = "MAX_VALUE";
    AuthType[AuthType["kSilent"] = 0] = "kSilent";
    AuthType[AuthType["kPopup"] = 1] = "kPopup";
})(AuthType || (AuthType = {}));
export class MicrosoftAuthUntrustedDocumentPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'new_tab_page.mojom.MicrosoftAuthUntrustedDocument', scope);
    }
}
export class MicrosoftAuthUntrustedDocumentRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(MicrosoftAuthUntrustedDocumentPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    acquireTokenPopup() {
        this.proxy.sendMessage(2080816061, MicrosoftAuthUntrustedDocument_AcquireTokenPopup_ParamsSpec.$, null, [], false);
    }
    acquireTokenSilent() {
        this.proxy.sendMessage(1482252029, MicrosoftAuthUntrustedDocument_AcquireTokenSilent_ParamsSpec.$, null, [], false);
    }
    signOut() {
        this.proxy.sendMessage(1586538105, MicrosoftAuthUntrustedDocument_SignOut_ParamsSpec.$, null, [], false);
    }
}
;
/**
 * An object which receives request messages for the MicrosoftAuthUntrustedDocument
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class MicrosoftAuthUntrustedDocumentReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(MicrosoftAuthUntrustedDocumentRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(2080816061, MicrosoftAuthUntrustedDocument_AcquireTokenPopup_ParamsSpec.$, null, impl.acquireTokenPopup.bind(impl), false);
        this.helper_internal_.registerHandler(1482252029, MicrosoftAuthUntrustedDocument_AcquireTokenSilent_ParamsSpec.$, null, impl.acquireTokenSilent.bind(impl), false);
        this.helper_internal_.registerHandler(1586538105, MicrosoftAuthUntrustedDocument_SignOut_ParamsSpec.$, null, impl.signOut.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class MicrosoftAuthUntrustedDocument {
    static get $interfaceName() {
        return "new_tab_page.mojom.MicrosoftAuthUntrustedDocument";
    }
    /**
     * Returns a remote for this interface which sends messages to the browser.
     * The browser must have an interface request binder registered for this
     * interface and accessible to the calling document's frame.
     */
    static getRemote() {
        let remote = new MicrosoftAuthUntrustedDocumentRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the MicrosoftAuthUntrustedDocument
 * mojom interface and dispatches them as callbacks. One callback receiver exists
 * on this object for each message defined in the mojom interface, and each
 * receiver can have any number of listeners added to it.
 */
export class MicrosoftAuthUntrustedDocumentCallbackRouter {
    helper_internal_;
    $;
    router_;
    acquireTokenPopup;
    acquireTokenSilent;
    signOut;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(MicrosoftAuthUntrustedDocumentRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.acquireTokenPopup =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2080816061, MicrosoftAuthUntrustedDocument_AcquireTokenPopup_ParamsSpec.$, null, this.acquireTokenPopup.createReceiverHandler(false /* expectsResponse */), false);
        this.acquireTokenSilent =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1482252029, MicrosoftAuthUntrustedDocument_AcquireTokenSilent_ParamsSpec.$, null, this.acquireTokenSilent.createReceiverHandler(false /* expectsResponse */), false);
        this.signOut =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1586538105, MicrosoftAuthUntrustedDocument_SignOut_ParamsSpec.$, null, this.signOut.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export const MicrosoftAuthUntrustedDocument_AcquireTokenPopup_ParamsSpec = { $: {} };
export const MicrosoftAuthUntrustedDocument_AcquireTokenSilent_ParamsSpec = { $: {} };
export const MicrosoftAuthUntrustedDocument_SignOut_ParamsSpec = { $: {} };
mojo.internal.Struct(MicrosoftAuthUntrustedDocument_AcquireTokenPopup_ParamsSpec.$, 'MicrosoftAuthUntrustedDocument_AcquireTokenPopup_Params', [], [[0, 8],]);
mojo.internal.Struct(MicrosoftAuthUntrustedDocument_AcquireTokenSilent_ParamsSpec.$, 'MicrosoftAuthUntrustedDocument_AcquireTokenSilent_Params', [], [[0, 8],]);
mojo.internal.Struct(MicrosoftAuthUntrustedDocument_SignOut_ParamsSpec.$, 'MicrosoftAuthUntrustedDocument_SignOut_Params', [], [[0, 8],]);
