// chrome/browser/ui/webui/ai_overlay_dialog/ai_overlay_dialog.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';
import { AiOverlayToolsPendingReceiver as aiOverlayDialog_mojom_AiOverlayToolsPendingReceiver } from './tools.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export class PageHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'ai_overlay_dialog.mojom.PageHandlerFactory', scope);
    }
}
export class PageHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createPageHandler(handler, page, tools) {
        this.proxy.sendMessage(640060973, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, [
            handler,
            page,
            tools
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(640060973, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, impl.createPageHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandlerFactory {
    static get $interfaceName() {
        return "ai_overlay_dialog.mojom.PageHandlerFactory";
    }
    /**
     * 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 PageHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandlerFactory
 * 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 PageHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createPageHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createPageHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(640060973, PageHandlerFactory_CreatePageHandler_ParamsSpec.$, null, this.createPageHandler.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 class PageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'ai_overlay_dialog.mojom.PageHandler', scope);
    }
}
export class PageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getMockAudioData() {
        return this.proxy.sendMessage(1539978309, PageHandler_GetMockAudioData_ParamsSpec.$, PageHandler_GetMockAudioData_ResponseParamsSpec.$, [], false);
    }
    updateAudioEnergy(energy) {
        this.proxy.sendMessage(247636839, PageHandler_UpdateAudioEnergy_ParamsSpec.$, null, [
            energy
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1539978309, PageHandler_GetMockAudioData_ParamsSpec.$, PageHandler_GetMockAudioData_ResponseParamsSpec.$, impl.getMockAudioData.bind(impl), false);
        this.helper_internal_.registerHandler(247636839, PageHandler_UpdateAudioEnergy_ParamsSpec.$, null, impl.updateAudioEnergy.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageHandler {
    static get $interfaceName() {
        return "ai_overlay_dialog.mojom.PageHandler";
    }
    /**
     * 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 PageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageHandler
 * 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 PageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getMockAudioData;
    updateAudioEnergy;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getMockAudioData =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1539978309, PageHandler_GetMockAudioData_ParamsSpec.$, PageHandler_GetMockAudioData_ResponseParamsSpec.$, this.getMockAudioData.createReceiverHandler(true /* expectsResponse */), false);
        this.updateAudioEnergy =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(247636839, PageHandler_UpdateAudioEnergy_ParamsSpec.$, null, this.updateAudioEnergy.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 class PagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'ai_overlay_dialog.mojom.Page', scope);
    }
}
export class PageRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    didChangePage(url, title, content) {
        this.proxy.sendMessage(216456993, Page_DidChangePage_ParamsSpec.$, null, [
            url,
            title,
            content
        ], false);
    }
    updateCurrentPageContext(pageTitle, rootNode) {
        this.proxy.sendMessage(2115470714, Page_UpdateCurrentPageContext_ParamsSpec.$, null, [
            pageTitle,
            rootNode
        ], false);
    }
    setInputCaptionsVisible(visible) {
        this.proxy.sendMessage(467410905, Page_SetInputCaptionsVisible_ParamsSpec.$, null, [
            visible
        ], false);
    }
    setOutputCaptionsVisible(visible) {
        this.proxy.sendMessage(500449593, Page_SetOutputCaptionsVisible_ParamsSpec.$, null, [
            visible
        ], false);
    }
    setUsePersona(usePersona) {
        this.proxy.sendMessage(1693200855, Page_SetUsePersona_ParamsSpec.$, null, [
            usePersona
        ], false);
    }
}
;
/**
 * An object which receives request messages for the Page
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(216456993, Page_DidChangePage_ParamsSpec.$, null, impl.didChangePage.bind(impl), false);
        this.helper_internal_.registerHandler(2115470714, Page_UpdateCurrentPageContext_ParamsSpec.$, null, impl.updateCurrentPageContext.bind(impl), false);
        this.helper_internal_.registerHandler(467410905, Page_SetInputCaptionsVisible_ParamsSpec.$, null, impl.setInputCaptionsVisible.bind(impl), false);
        this.helper_internal_.registerHandler(500449593, Page_SetOutputCaptionsVisible_ParamsSpec.$, null, impl.setOutputCaptionsVisible.bind(impl), false);
        this.helper_internal_.registerHandler(1693200855, Page_SetUsePersona_ParamsSpec.$, null, impl.setUsePersona.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Page {
    static get $interfaceName() {
        return "ai_overlay_dialog.mojom.Page";
    }
    /**
     * 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 PageRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Page
 * 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 PageCallbackRouter {
    helper_internal_;
    $;
    router_;
    didChangePage;
    updateCurrentPageContext;
    setInputCaptionsVisible;
    setOutputCaptionsVisible;
    setUsePersona;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.didChangePage =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(216456993, Page_DidChangePage_ParamsSpec.$, null, this.didChangePage.createReceiverHandler(false /* expectsResponse */), false);
        this.updateCurrentPageContext =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2115470714, Page_UpdateCurrentPageContext_ParamsSpec.$, null, this.updateCurrentPageContext.createReceiverHandler(false /* expectsResponse */), false);
        this.setInputCaptionsVisible =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(467410905, Page_SetInputCaptionsVisible_ParamsSpec.$, null, this.setInputCaptionsVisible.createReceiverHandler(false /* expectsResponse */), false);
        this.setOutputCaptionsVisible =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(500449593, Page_SetOutputCaptionsVisible_ParamsSpec.$, null, this.setOutputCaptionsVisible.createReceiverHandler(false /* expectsResponse */), false);
        this.setUsePersona =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1693200855, Page_SetUsePersona_ParamsSpec.$, null, this.setUsePersona.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 PageContentNodeSpec = { $: {} };
export const PageHandlerFactory_CreatePageHandler_ParamsSpec = { $: {} };
export const PageHandler_GetMockAudioData_ParamsSpec = { $: {} };
export const PageHandler_GetMockAudioData_ResponseParamsSpec = { $: {} };
export const PageHandler_UpdateAudioEnergy_ParamsSpec = { $: {} };
export const Page_DidChangePage_ParamsSpec = { $: {} };
export const Page_UpdateCurrentPageContext_ParamsSpec = { $: {} };
export const Page_SetInputCaptionsVisible_ParamsSpec = { $: {} };
export const Page_SetOutputCaptionsVisible_ParamsSpec = { $: {} };
export const Page_SetUsePersona_ParamsSpec = { $: {} };
mojo.internal.Struct(PageContentNodeSpec.$, 'PageContentNode', [
    mojo.internal.StructField('domNodeId', 0, 0, mojo.internal.Int32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('tagName', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('text', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('url', 24, 0, url_mojom_UrlSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isInteractive', 4, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('children', 32, 0, mojo.internal.Array(PageContentNodeSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 48],]);
mojo.internal.Struct(PageHandlerFactory_CreatePageHandler_ParamsSpec.$, 'PageHandlerFactory_CreatePageHandler_Params', [
    mojo.internal.StructField('handler', 0, 0, mojo.internal.InterfaceRequest(PageHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('page', 4, 0, mojo.internal.InterfaceProxy(PageRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('tools', 12, 0, mojo.internal.InterfaceRequest(aiOverlayDialog_mojom_AiOverlayToolsPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(PageHandler_GetMockAudioData_ParamsSpec.$, 'PageHandler_GetMockAudioData_Params', [], [[0, 8],]);
mojo.internal.Struct(PageHandler_GetMockAudioData_ResponseParamsSpec.$, 'PageHandler_GetMockAudioData_ResponseParams', [
    mojo.internal.StructField('jsonData', 0, 0, mojo.internal.String, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageHandler_UpdateAudioEnergy_ParamsSpec.$, 'PageHandler_UpdateAudioEnergy_Params', [
    mojo.internal.StructField('energy', 0, 0, mojo.internal.Float, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_DidChangePage_ParamsSpec.$, 'Page_DidChangePage_Params', [
    mojo.internal.StructField('url', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('title', 8, 0, mojo.internal.String, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('content', 16, 0, mojo.internal.String, null, true /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(Page_UpdateCurrentPageContext_ParamsSpec.$, 'Page_UpdateCurrentPageContext_Params', [
    mojo.internal.StructField('pageTitle', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('rootNode', 8, 0, PageContentNodeSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(Page_SetInputCaptionsVisible_ParamsSpec.$, 'Page_SetInputCaptionsVisible_Params', [
    mojo.internal.StructField('visible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_SetOutputCaptionsVisible_ParamsSpec.$, 'Page_SetOutputCaptionsVisible_Params', [
    mojo.internal.StructField('visible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Page_SetUsePersona_ParamsSpec.$, 'Page_SetUsePersona_Params', [
    mojo.internal.StructField('usePersona', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
