// components/site_engagement/core/mojom/site_engagement_details.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 { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export class SiteEngagementDetailsProviderPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'site_engagement.mojom.SiteEngagementDetailsProvider', scope);
    }
}
export class SiteEngagementDetailsProviderRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(SiteEngagementDetailsProviderPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getSiteEngagementDetails() {
        return this.proxy.sendMessage(556726439, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ParamsSpec.$, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParamsSpec.$, [], false);
    }
    setSiteEngagementBaseScoreForUrl(url, score) {
        this.proxy.sendMessage(602065552, SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_ParamsSpec.$, null, [
            url,
            score
        ], false);
    }
}
;
/**
 * An object which receives request messages for the SiteEngagementDetailsProvider
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class SiteEngagementDetailsProviderReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(SiteEngagementDetailsProviderRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(556726439, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ParamsSpec.$, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParamsSpec.$, impl.getSiteEngagementDetails.bind(impl), false);
        this.helper_internal_.registerHandler(602065552, SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_ParamsSpec.$, null, impl.setSiteEngagementBaseScoreForUrl.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class SiteEngagementDetailsProvider {
    static get $interfaceName() {
        return "site_engagement.mojom.SiteEngagementDetailsProvider";
    }
    /**
     * 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 SiteEngagementDetailsProviderRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the SiteEngagementDetailsProvider
 * 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 SiteEngagementDetailsProviderCallbackRouter {
    helper_internal_;
    $;
    router_;
    getSiteEngagementDetails;
    setSiteEngagementBaseScoreForUrl;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(SiteEngagementDetailsProviderRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getSiteEngagementDetails =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(556726439, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ParamsSpec.$, SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParamsSpec.$, this.getSiteEngagementDetails.createReceiverHandler(true /* expectsResponse */), false);
        this.setSiteEngagementBaseScoreForUrl =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(602065552, SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_ParamsSpec.$, null, this.setSiteEngagementBaseScoreForUrl.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 SiteEngagementDetailsSpec = { $: {} };
export const SiteEngagementDetailsProvider_GetSiteEngagementDetails_ParamsSpec = { $: {} };
export const SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParamsSpec = { $: {} };
export const SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_ParamsSpec = { $: {} };
mojo.internal.Struct(SiteEngagementDetailsSpec.$, 'SiteEngagementDetails', [
    mojo.internal.StructField('origin', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('totalScore', 8, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('baseScore', 16, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('installedBonus', 24, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
mojo.internal.Struct(SiteEngagementDetailsProvider_GetSiteEngagementDetails_ParamsSpec.$, 'SiteEngagementDetailsProvider_GetSiteEngagementDetails_Params', [], [[0, 8],]);
mojo.internal.Struct(SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParamsSpec.$, 'SiteEngagementDetailsProvider_GetSiteEngagementDetails_ResponseParams', [
    mojo.internal.StructField('info', 0, 0, mojo.internal.Array(SiteEngagementDetailsSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_ParamsSpec.$, 'SiteEngagementDetailsProvider_SetSiteEngagementBaseScoreForUrl_Params', [
    mojo.internal.StructField('url', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('score', 8, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
