// ui/webui/resources/cr_components/help_bubble/custom_help_bubble.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 CustomHelpBubbleUserActionSpec = { $: mojo.internal.Enum() };
export var CustomHelpBubbleUserAction;
(function (CustomHelpBubbleUserAction) {
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["MIN_VALUE"] = 0] = "MIN_VALUE";
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["MAX_VALUE"] = 3] = "MAX_VALUE";
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["kDismiss"] = 0] = "kDismiss";
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["kSnooze"] = 1] = "kSnooze";
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["kAction"] = 2] = "kAction";
    CustomHelpBubbleUserAction[CustomHelpBubbleUserAction["kCancel"] = 3] = "kCancel";
})(CustomHelpBubbleUserAction || (CustomHelpBubbleUserAction = {}));
export class CustomHelpBubbleHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'custom_help_bubble.mojom.CustomHelpBubbleHandlerFactory', scope);
    }
}
export class CustomHelpBubbleHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CustomHelpBubbleHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createCustomHelpBubbleHandler(handler) {
        this.proxy.sendMessage(1706539725, CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_ParamsSpec.$, null, [
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CustomHelpBubbleHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CustomHelpBubbleHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomHelpBubbleHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1706539725, CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_ParamsSpec.$, null, impl.createCustomHelpBubbleHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CustomHelpBubbleHandlerFactory {
    static get $interfaceName() {
        return "custom_help_bubble.mojom.CustomHelpBubbleHandlerFactory";
    }
    /**
     * 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 CustomHelpBubbleHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CustomHelpBubbleHandlerFactory
 * 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 CustomHelpBubbleHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createCustomHelpBubbleHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomHelpBubbleHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createCustomHelpBubbleHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1706539725, CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_ParamsSpec.$, null, this.createCustomHelpBubbleHandler.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 CustomHelpBubbleHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'custom_help_bubble.mojom.CustomHelpBubbleHandler', scope);
    }
}
export class CustomHelpBubbleHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CustomHelpBubbleHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    notifyUserAction(action) {
        this.proxy.sendMessage(9870048, CustomHelpBubbleHandler_NotifyUserAction_ParamsSpec.$, null, [
            action
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CustomHelpBubbleHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CustomHelpBubbleHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomHelpBubbleHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(9870048, CustomHelpBubbleHandler_NotifyUserAction_ParamsSpec.$, null, impl.notifyUserAction.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CustomHelpBubbleHandler {
    static get $interfaceName() {
        return "custom_help_bubble.mojom.CustomHelpBubbleHandler";
    }
    /**
     * 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 CustomHelpBubbleHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CustomHelpBubbleHandler
 * 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 CustomHelpBubbleHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    notifyUserAction;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CustomHelpBubbleHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.notifyUserAction =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(9870048, CustomHelpBubbleHandler_NotifyUserAction_ParamsSpec.$, null, this.notifyUserAction.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 CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_ParamsSpec = { $: {} };
export const CustomHelpBubbleHandler_NotifyUserAction_ParamsSpec = { $: {} };
mojo.internal.Struct(CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_ParamsSpec.$, 'CustomHelpBubbleHandlerFactory_CreateCustomHelpBubbleHandler_Params', [
    mojo.internal.StructField('handler', 0, 0, mojo.internal.InterfaceRequest(CustomHelpBubbleHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CustomHelpBubbleHandler_NotifyUserAction_ParamsSpec.$, 'CustomHelpBubbleHandler_NotifyUserAction_Params', [
    mojo.internal.StructField('action', 0, 0, CustomHelpBubbleUserActionSpec.$, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
