// components/commerce/core/internals/mojom/commerce_internals.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 { MojoBrowserProxyFactory } from '//resources/mojo/mojo_browser_proxy.js';
import { BookmarkProductInfoSpec as commerce_shared_mojom_BookmarkProductInfoSpec, ProductInfoSpec as commerce_shared_mojom_ProductInfoSpec } from './shared.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export class CommerceInternalsHandlerFactoryPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'commerce.mojom.CommerceInternalsHandlerFactory', scope);
    }
}
export class CommerceInternalsHandlerFactoryRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CommerceInternalsHandlerFactoryPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    createCommerceInternalsHandler(page, handler) {
        this.proxy.sendMessage(593775749, CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_ParamsSpec.$, null, [
            page,
            handler
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CommerceInternalsHandlerFactory
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CommerceInternalsHandlerFactoryReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(593775749, CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_ParamsSpec.$, null, impl.createCommerceInternalsHandler.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CommerceInternalsHandlerFactory {
    static get $interfaceName() {
        return "commerce.mojom.CommerceInternalsHandlerFactory";
    }
    /**
     * 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 CommerceInternalsHandlerFactoryRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CommerceInternalsHandlerFactory
 * 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 CommerceInternalsHandlerFactoryCallbackRouter {
    helper_internal_;
    $;
    router_;
    createCommerceInternalsHandler;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsHandlerFactoryRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.createCommerceInternalsHandler =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(593775749, CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_ParamsSpec.$, null, this.createCommerceInternalsHandler.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 CommerceInternalsHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'commerce.mojom.CommerceInternalsHandler', scope);
    }
}
export class CommerceInternalsHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CommerceInternalsHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getIsShoppingListEligible() {
        return this.proxy.sendMessage(971346947, CommerceInternalsHandler_GetIsShoppingListEligible_ParamsSpec.$, CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParamsSpec.$, [], false);
    }
    resetPriceTrackingEmailPref() {
        this.proxy.sendMessage(1731149322, CommerceInternalsHandler_ResetPriceTrackingEmailPref_ParamsSpec.$, null, [], false);
    }
    getProductInfoForUrl(url) {
        return this.proxy.sendMessage(814875356, CommerceInternalsHandler_GetProductInfoForUrl_ParamsSpec.$, CommerceInternalsHandler_GetProductInfoForUrl_ResponseParamsSpec.$, [
            url
        ], false);
    }
    getSubscriptionDetails() {
        return this.proxy.sendMessage(1115279706, CommerceInternalsHandler_GetSubscriptionDetails_ParamsSpec.$, CommerceInternalsHandler_GetSubscriptionDetails_ResponseParamsSpec.$, [], false);
    }
    getShoppingEligibilityDetails() {
        return this.proxy.sendMessage(1707857286, CommerceInternalsHandler_GetShoppingEligibilityDetails_ParamsSpec.$, CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the CommerceInternalsHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CommerceInternalsHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(971346947, CommerceInternalsHandler_GetIsShoppingListEligible_ParamsSpec.$, CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParamsSpec.$, impl.getIsShoppingListEligible.bind(impl), false);
        this.helper_internal_.registerHandler(1731149322, CommerceInternalsHandler_ResetPriceTrackingEmailPref_ParamsSpec.$, null, impl.resetPriceTrackingEmailPref.bind(impl), false);
        this.helper_internal_.registerHandler(814875356, CommerceInternalsHandler_GetProductInfoForUrl_ParamsSpec.$, CommerceInternalsHandler_GetProductInfoForUrl_ResponseParamsSpec.$, impl.getProductInfoForUrl.bind(impl), false);
        this.helper_internal_.registerHandler(1115279706, CommerceInternalsHandler_GetSubscriptionDetails_ParamsSpec.$, CommerceInternalsHandler_GetSubscriptionDetails_ResponseParamsSpec.$, impl.getSubscriptionDetails.bind(impl), false);
        this.helper_internal_.registerHandler(1707857286, CommerceInternalsHandler_GetShoppingEligibilityDetails_ParamsSpec.$, CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParamsSpec.$, impl.getShoppingEligibilityDetails.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CommerceInternalsHandler {
    static get $interfaceName() {
        return "commerce.mojom.CommerceInternalsHandler";
    }
    /**
     * 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 CommerceInternalsHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CommerceInternalsHandler
 * 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 CommerceInternalsHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getIsShoppingListEligible;
    resetPriceTrackingEmailPref;
    getProductInfoForUrl;
    getSubscriptionDetails;
    getShoppingEligibilityDetails;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getIsShoppingListEligible =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(971346947, CommerceInternalsHandler_GetIsShoppingListEligible_ParamsSpec.$, CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParamsSpec.$, this.getIsShoppingListEligible.createReceiverHandler(true /* expectsResponse */), false);
        this.resetPriceTrackingEmailPref =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1731149322, CommerceInternalsHandler_ResetPriceTrackingEmailPref_ParamsSpec.$, null, this.resetPriceTrackingEmailPref.createReceiverHandler(false /* expectsResponse */), false);
        this.getProductInfoForUrl =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(814875356, CommerceInternalsHandler_GetProductInfoForUrl_ParamsSpec.$, CommerceInternalsHandler_GetProductInfoForUrl_ResponseParamsSpec.$, this.getProductInfoForUrl.createReceiverHandler(true /* expectsResponse */), false);
        this.getSubscriptionDetails =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1115279706, CommerceInternalsHandler_GetSubscriptionDetails_ParamsSpec.$, CommerceInternalsHandler_GetSubscriptionDetails_ResponseParamsSpec.$, this.getSubscriptionDetails.createReceiverHandler(true /* expectsResponse */), false);
        this.getShoppingEligibilityDetails =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1707857286, CommerceInternalsHandler_GetShoppingEligibilityDetails_ParamsSpec.$, CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParamsSpec.$, this.getShoppingEligibilityDetails.createReceiverHandler(true /* 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 CommerceInternalsPagePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'commerce.mojom.CommerceInternalsPage', scope);
    }
}
export class CommerceInternalsPageRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(CommerceInternalsPagePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onShoppingListEligibilityChanged(eligible) {
        this.proxy.sendMessage(1550030041, CommerceInternalsPage_OnShoppingListEligibilityChanged_ParamsSpec.$, null, [
            eligible
        ], false);
    }
}
;
/**
 * An object which receives request messages for the CommerceInternalsPage
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class CommerceInternalsPageReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsPageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1550030041, CommerceInternalsPage_OnShoppingListEligibilityChanged_ParamsSpec.$, null, impl.onShoppingListEligibilityChanged.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class CommerceInternalsPage {
    static get $interfaceName() {
        return "commerce.mojom.CommerceInternalsPage";
    }
    /**
     * 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 CommerceInternalsPageRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the CommerceInternalsPage
 * 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 CommerceInternalsPageCallbackRouter {
    helper_internal_;
    $;
    router_;
    onShoppingListEligibilityChanged;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(CommerceInternalsPageRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onShoppingListEligibilityChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1550030041, CommerceInternalsPage_OnShoppingListEligibilityChanged_ParamsSpec.$, null, this.onShoppingListEligibilityChanged.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 EligibilityDetailSpec = { $: {} };
export const ShoppingEligibilityDetailsSpec = { $: {} };
export const SubscriptionSpec = { $: {} };
export const CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetIsShoppingListEligible_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParamsSpec = { $: {} };
export const CommerceInternalsHandler_ResetPriceTrackingEmailPref_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetProductInfoForUrl_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetProductInfoForUrl_ResponseParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetSubscriptionDetails_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetSubscriptionDetails_ResponseParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetShoppingEligibilityDetails_ParamsSpec = { $: {} };
export const CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParamsSpec = { $: {} };
export const CommerceInternalsPage_OnShoppingListEligibilityChanged_ParamsSpec = { $: {} };
mojo.internal.Struct(EligibilityDetailSpec.$, 'EligibilityDetail', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('value', 8, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('expectedValue', 8, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(ShoppingEligibilityDetailsSpec.$, 'ShoppingEligibilityDetails', [
    mojo.internal.StructField('country', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('locale', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('details', 16, 0, mojo.internal.Array(EligibilityDetailSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(SubscriptionSpec.$, 'Subscription', [
    mojo.internal.StructField('clusterId', 0, 0, mojo.internal.Uint64, BigInt(0), false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('productInfos', 8, 0, mojo.internal.Array(commerce_shared_mojom_BookmarkProductInfoSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_ParamsSpec.$, 'CommerceInternalsHandlerFactory_CreateCommerceInternalsHandler_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(CommerceInternalsPageRemote), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('handler', 8, 0, mojo.internal.InterfaceRequest(CommerceInternalsHandlerPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(CommerceInternalsHandler_GetIsShoppingListEligible_ParamsSpec.$, 'CommerceInternalsHandler_GetIsShoppingListEligible_Params', [], [[0, 8],]);
mojo.internal.Struct(CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParamsSpec.$, 'CommerceInternalsHandler_GetIsShoppingListEligible_ResponseParams', [
    mojo.internal.StructField('eligible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommerceInternalsHandler_ResetPriceTrackingEmailPref_ParamsSpec.$, 'CommerceInternalsHandler_ResetPriceTrackingEmailPref_Params', [], [[0, 8],]);
mojo.internal.Struct(CommerceInternalsHandler_GetProductInfoForUrl_ParamsSpec.$, 'CommerceInternalsHandler_GetProductInfoForUrl_Params', [
    mojo.internal.StructField('url', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommerceInternalsHandler_GetProductInfoForUrl_ResponseParamsSpec.$, 'CommerceInternalsHandler_GetProductInfoForUrl_ResponseParams', [
    mojo.internal.StructField('info', 0, 0, commerce_shared_mojom_ProductInfoSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommerceInternalsHandler_GetSubscriptionDetails_ParamsSpec.$, 'CommerceInternalsHandler_GetSubscriptionDetails_Params', [], [[0, 8],]);
mojo.internal.Struct(CommerceInternalsHandler_GetSubscriptionDetails_ResponseParamsSpec.$, 'CommerceInternalsHandler_GetSubscriptionDetails_ResponseParams', [
    mojo.internal.StructField('subscriptions', 0, 0, mojo.internal.Array(SubscriptionSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommerceInternalsHandler_GetShoppingEligibilityDetails_ParamsSpec.$, 'CommerceInternalsHandler_GetShoppingEligibilityDetails_Params', [], [[0, 8],]);
mojo.internal.Struct(CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParamsSpec.$, 'CommerceInternalsHandler_GetShoppingEligibilityDetails_ResponseParams', [
    mojo.internal.StructField('details', 0, 0, ShoppingEligibilityDetailsSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(CommerceInternalsPage_OnShoppingListEligibilityChanged_ParamsSpec.$, 'CommerceInternalsPage_OnShoppingListEligibilityChanged_Params', [
    mojo.internal.StructField('eligible', 0, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
export const browserProxyFactory = new MojoBrowserProxyFactory(CommerceInternalsHandlerRemote, CommerceInternalsPageCallbackRouter, (remote, receiver) => CommerceInternalsHandlerFactory.getRemote().createCommerceInternalsHandler(remote, receiver));
