// content/test/data/web_ui_managed_interface_test.test-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 FooPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'content.mojom.Foo', scope);
    }
}
export class FooRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(FooPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getFoo() {
        return this.proxy.sendMessage(1032185046, Foo_GetFoo_ParamsSpec.$, Foo_GetFoo_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the Foo
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class FooReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(FooRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1032185046, Foo_GetFoo_ParamsSpec.$, Foo_GetFoo_ResponseParamsSpec.$, impl.getFoo.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Foo {
    static get $interfaceName() {
        return "content.mojom.Foo";
    }
    /**
     * 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 FooRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Foo
 * 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 FooCallbackRouter {
    helper_internal_;
    $;
    router_;
    getFoo;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(FooRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getFoo =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1032185046, Foo_GetFoo_ParamsSpec.$, Foo_GetFoo_ResponseParamsSpec.$, this.getFoo.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 BarPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'content.mojom.Bar', scope);
    }
}
export class BarRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(BarPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getBar() {
        return this.proxy.sendMessage(89958904, Bar_GetBar_ParamsSpec.$, Bar_GetBar_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the Bar
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class BarReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BarRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(89958904, Bar_GetBar_ParamsSpec.$, Bar_GetBar_ResponseParamsSpec.$, impl.getBar.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Bar {
    static get $interfaceName() {
        return "content.mojom.Bar";
    }
    /**
     * 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 BarRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Bar
 * 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 BarCallbackRouter {
    helper_internal_;
    $;
    router_;
    getBar;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BarRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getBar =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(89958904, Bar_GetBar_ParamsSpec.$, Bar_GetBar_ResponseParamsSpec.$, this.getBar.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 BazPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'content.mojom.Baz', scope);
    }
}
export class BazRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(BazPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getBaz() {
        return this.proxy.sendMessage(1119957697, Baz_GetBaz_ParamsSpec.$, Baz_GetBaz_ResponseParamsSpec.$, [], false);
    }
}
;
/**
 * An object which receives request messages for the Baz
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class BazReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BazRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1119957697, Baz_GetBaz_ParamsSpec.$, Baz_GetBaz_ResponseParamsSpec.$, impl.getBaz.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class Baz {
    static get $interfaceName() {
        return "content.mojom.Baz";
    }
    /**
     * 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 BazRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the Baz
 * 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 BazCallbackRouter {
    helper_internal_;
    $;
    router_;
    getBaz;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(BazRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getBaz =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1119957697, Baz_GetBaz_ParamsSpec.$, Baz_GetBaz_ResponseParamsSpec.$, this.getBaz.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 TestWebUIJsBridgePendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'content.mojom.TestWebUIJsBridge', scope);
    }
}
export class TestWebUIJsBridgeRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(TestWebUIJsBridgePendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    bindFoo(foo) {
        this.proxy.sendMessage(670696340, TestWebUIJsBridge_BindFoo_ParamsSpec.$, null, [
            foo
        ], false);
    }
    bindFooBar(foo, bar) {
        this.proxy.sendMessage(1837578698, TestWebUIJsBridge_BindFooBar_ParamsSpec.$, null, [
            foo,
            bar
        ], false);
    }
    bindBaz(baz) {
        this.proxy.sendMessage(257097341, TestWebUIJsBridge_BindBaz_ParamsSpec.$, null, [
            baz
        ], false);
    }
}
;
/**
 * An object which receives request messages for the TestWebUIJsBridge
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class TestWebUIJsBridgeReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(TestWebUIJsBridgeRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(670696340, TestWebUIJsBridge_BindFoo_ParamsSpec.$, null, impl.bindFoo.bind(impl), false);
        this.helper_internal_.registerHandler(1837578698, TestWebUIJsBridge_BindFooBar_ParamsSpec.$, null, impl.bindFooBar.bind(impl), false);
        this.helper_internal_.registerHandler(257097341, TestWebUIJsBridge_BindBaz_ParamsSpec.$, null, impl.bindBaz.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class TestWebUIJsBridge {
    static get $interfaceName() {
        return "content.mojom.TestWebUIJsBridge";
    }
    /**
     * 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 TestWebUIJsBridgeRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the TestWebUIJsBridge
 * 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 TestWebUIJsBridgeCallbackRouter {
    helper_internal_;
    $;
    router_;
    bindFoo;
    bindFooBar;
    bindBaz;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(TestWebUIJsBridgeRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.bindFoo =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(670696340, TestWebUIJsBridge_BindFoo_ParamsSpec.$, null, this.bindFoo.createReceiverHandler(false /* expectsResponse */), false);
        this.bindFooBar =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1837578698, TestWebUIJsBridge_BindFooBar_ParamsSpec.$, null, this.bindFooBar.createReceiverHandler(false /* expectsResponse */), false);
        this.bindBaz =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(257097341, TestWebUIJsBridge_BindBaz_ParamsSpec.$, null, this.bindBaz.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 Foo_GetFoo_ParamsSpec = { $: {} };
export const Foo_GetFoo_ResponseParamsSpec = { $: {} };
export const Bar_GetBar_ParamsSpec = { $: {} };
export const Bar_GetBar_ResponseParamsSpec = { $: {} };
export const Baz_GetBaz_ParamsSpec = { $: {} };
export const Baz_GetBaz_ResponseParamsSpec = { $: {} };
export const TestWebUIJsBridge_BindFoo_ParamsSpec = { $: {} };
export const TestWebUIJsBridge_BindFooBar_ParamsSpec = { $: {} };
export const TestWebUIJsBridge_BindBaz_ParamsSpec = { $: {} };
mojo.internal.Struct(Foo_GetFoo_ParamsSpec.$, 'Foo_GetFoo_Params', [], [[0, 8],]);
mojo.internal.Struct(Foo_GetFoo_ResponseParamsSpec.$, 'Foo_GetFoo_ResponseParams', [
    mojo.internal.StructField('value', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Bar_GetBar_ParamsSpec.$, 'Bar_GetBar_Params', [], [[0, 8],]);
mojo.internal.Struct(Bar_GetBar_ResponseParamsSpec.$, 'Bar_GetBar_ResponseParams', [
    mojo.internal.StructField('value', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(Baz_GetBaz_ParamsSpec.$, 'Baz_GetBaz_Params', [], [[0, 8],]);
mojo.internal.Struct(Baz_GetBaz_ResponseParamsSpec.$, 'Baz_GetBaz_ResponseParams', [
    mojo.internal.StructField('value', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(TestWebUIJsBridge_BindFoo_ParamsSpec.$, 'TestWebUIJsBridge_BindFoo_Params', [
    mojo.internal.StructField('foo', 0, 0, mojo.internal.InterfaceRequest(FooPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(TestWebUIJsBridge_BindFooBar_ParamsSpec.$, 'TestWebUIJsBridge_BindFooBar_Params', [
    mojo.internal.StructField('foo', 0, 0, mojo.internal.InterfaceRequest(FooPendingReceiver), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('bar', 4, 0, mojo.internal.InterfaceProxy(BarRemote), null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(TestWebUIJsBridge_BindBaz_ParamsSpec.$, 'TestWebUIJsBridge_BindBaz_Params', [
    mojo.internal.StructField('baz', 0, 0, mojo.internal.InterfaceProxy(BazRemote), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
