// chrome/browser/new_tab_page/modules/v2/calendar/outlook_calendar.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 { CalendarEventSpec as ntp_calendar_mojom_CalendarEventSpec } from './calendar_data.mojom-webui.js';
export class OutlookCalendarPageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'ntp.calendar.mojom.OutlookCalendarPageHandler', scope);
    }
}
export class OutlookCalendarPageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(OutlookCalendarPageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getEvents() {
        return this.proxy.sendMessage(731733770, OutlookCalendarPageHandler_GetEvents_ParamsSpec.$, OutlookCalendarPageHandler_GetEvents_ResponseParamsSpec.$, [], false);
    }
    dismissModule() {
        this.proxy.sendMessage(75681843, OutlookCalendarPageHandler_DismissModule_ParamsSpec.$, null, [], false);
    }
    restoreModule() {
        this.proxy.sendMessage(593738792, OutlookCalendarPageHandler_RestoreModule_ParamsSpec.$, null, [], false);
    }
}
;
/**
 * An object which receives request messages for the OutlookCalendarPageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class OutlookCalendarPageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(OutlookCalendarPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(731733770, OutlookCalendarPageHandler_GetEvents_ParamsSpec.$, OutlookCalendarPageHandler_GetEvents_ResponseParamsSpec.$, impl.getEvents.bind(impl), false);
        this.helper_internal_.registerHandler(75681843, OutlookCalendarPageHandler_DismissModule_ParamsSpec.$, null, impl.dismissModule.bind(impl), false);
        this.helper_internal_.registerHandler(593738792, OutlookCalendarPageHandler_RestoreModule_ParamsSpec.$, null, impl.restoreModule.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class OutlookCalendarPageHandler {
    static get $interfaceName() {
        return "ntp.calendar.mojom.OutlookCalendarPageHandler";
    }
    /**
     * 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 OutlookCalendarPageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the OutlookCalendarPageHandler
 * 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 OutlookCalendarPageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getEvents;
    dismissModule;
    restoreModule;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(OutlookCalendarPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getEvents =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(731733770, OutlookCalendarPageHandler_GetEvents_ParamsSpec.$, OutlookCalendarPageHandler_GetEvents_ResponseParamsSpec.$, this.getEvents.createReceiverHandler(true /* expectsResponse */), false);
        this.dismissModule =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(75681843, OutlookCalendarPageHandler_DismissModule_ParamsSpec.$, null, this.dismissModule.createReceiverHandler(false /* expectsResponse */), false);
        this.restoreModule =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(593738792, OutlookCalendarPageHandler_RestoreModule_ParamsSpec.$, null, this.restoreModule.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 OutlookCalendarPageHandler_GetEvents_ParamsSpec = { $: {} };
export const OutlookCalendarPageHandler_GetEvents_ResponseParamsSpec = { $: {} };
export const OutlookCalendarPageHandler_DismissModule_ParamsSpec = { $: {} };
export const OutlookCalendarPageHandler_RestoreModule_ParamsSpec = { $: {} };
mojo.internal.Struct(OutlookCalendarPageHandler_GetEvents_ParamsSpec.$, 'OutlookCalendarPageHandler_GetEvents_Params', [], [[0, 8],]);
mojo.internal.Struct(OutlookCalendarPageHandler_GetEvents_ResponseParamsSpec.$, 'OutlookCalendarPageHandler_GetEvents_ResponseParams', [
    mojo.internal.StructField('events', 0, 0, mojo.internal.Array(ntp_calendar_mojom_CalendarEventSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(OutlookCalendarPageHandler_DismissModule_ParamsSpec.$, 'OutlookCalendarPageHandler_DismissModule_Params', [], [[0, 8],]);
mojo.internal.Struct(OutlookCalendarPageHandler_RestoreModule_ParamsSpec.$, 'OutlookCalendarPageHandler_RestoreModule_Params', [], [[0, 8],]);
