// chrome/browser/ui/webui/app_service_internals/app_service_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';
export class AppServiceInternalsPageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'mojom.app_service_internals.AppServiceInternalsPageHandler', scope);
    }
}
export class AppServiceInternalsPageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(AppServiceInternalsPageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getDebugInfo() {
        return this.proxy.sendMessage(111584601, AppServiceInternalsPageHandler_GetDebugInfo_ParamsSpec.$, AppServiceInternalsPageHandler_GetDebugInfo_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the AppServiceInternalsPageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class AppServiceInternalsPageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(AppServiceInternalsPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(111584601, AppServiceInternalsPageHandler_GetDebugInfo_ParamsSpec.$, AppServiceInternalsPageHandler_GetDebugInfo_ResponseParamsSpec.$, impl.getDebugInfo.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class AppServiceInternalsPageHandler {
    static get $interfaceName() {
        return "mojom.app_service_internals.AppServiceInternalsPageHandler";
    }
    /**
     * 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 AppServiceInternalsPageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the AppServiceInternalsPageHandler
 * 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 AppServiceInternalsPageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getDebugInfo;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(AppServiceInternalsPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getDebugInfo =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(111584601, AppServiceInternalsPageHandler_GetDebugInfo_ParamsSpec.$, AppServiceInternalsPageHandler_GetDebugInfo_ResponseParamsSpec.$, this.getDebugInfo.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 const AppInfoSpec = { $: {} };
export const PreferredAppInfoSpec = { $: {} };
export const PromiseAppInfoSpec = { $: {} };
export const AppCapabilityInfoSpec = { $: {} };
export const DebugInfoSpec = { $: {} };
export const AppServiceInternalsPageHandler_GetDebugInfo_ParamsSpec = { $: {} };
export const AppServiceInternalsPageHandler_GetDebugInfo_ResponseParamsSpec = { $: {} };
mojo.internal.Struct(AppInfoSpec.$, 'AppInfo', [
    mojo.internal.StructField('id', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('name', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('debugInfo', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(PreferredAppInfoSpec.$, 'PreferredAppInfo', [
    mojo.internal.StructField('id', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('name', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('preferredFilters', 16, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(PromiseAppInfoSpec.$, 'PromiseAppInfo', [
    mojo.internal.StructField('packageId', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('debugInfo', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(AppCapabilityInfoSpec.$, 'AppCapabilityInfo', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('debugInfo', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(DebugInfoSpec.$, 'DebugInfo', [
    mojo.internal.StructField('appList', 0, 0, mojo.internal.Array(AppInfoSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('preferredAppList', 8, 0, mojo.internal.Array(PreferredAppInfoSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('promiseAppList', 16, 0, mojo.internal.Array(PromiseAppInfoSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('appCapabilityList', 24, 0, mojo.internal.Array(AppCapabilityInfoSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
mojo.internal.Struct(AppServiceInternalsPageHandler_GetDebugInfo_ParamsSpec.$, 'AppServiceInternalsPageHandler_GetDebugInfo_Params', [], [[0, 8],]);
mojo.internal.Struct(AppServiceInternalsPageHandler_GetDebugInfo_ResponseParamsSpec.$, 'AppServiceInternalsPageHandler_GetDebugInfo_ResponseParams', [
    mojo.internal.StructField('debugInfo', 0, 0, DebugInfoSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
