// chrome/browser/new_tab_page/modules/file_suggestion/microsoft_files.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 { FileSpec as fileSuggestion_mojom_FileSpec } from './file_suggestion.mojom-webui.js';
export class MicrosoftFilesPageHandlerPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'file_suggestion.mojom.MicrosoftFilesPageHandler', scope);
    }
}
export class MicrosoftFilesPageHandlerRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(MicrosoftFilesPageHandlerPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    getFiles() {
        return this.proxy.sendMessage(1951234855, MicrosoftFilesPageHandler_GetFiles_ParamsSpec.$, MicrosoftFilesPageHandler_GetFiles_ResponseParamsSpec.$, [], false);
    }
    dismissModule() {
        this.proxy.sendMessage(1943009901, MicrosoftFilesPageHandler_DismissModule_ParamsSpec.$, null, [], false);
    }
    restoreModule() {
        this.proxy.sendMessage(1996872233, MicrosoftFilesPageHandler_RestoreModule_ParamsSpec.$, null, [], false);
    }
}
;
/**
 * An object which receives request messages for the MicrosoftFilesPageHandler
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class MicrosoftFilesPageHandlerReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(MicrosoftFilesPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(1951234855, MicrosoftFilesPageHandler_GetFiles_ParamsSpec.$, MicrosoftFilesPageHandler_GetFiles_ResponseParamsSpec.$, impl.getFiles.bind(impl), false);
        this.helper_internal_.registerHandler(1943009901, MicrosoftFilesPageHandler_DismissModule_ParamsSpec.$, null, impl.dismissModule.bind(impl), false);
        this.helper_internal_.registerHandler(1996872233, MicrosoftFilesPageHandler_RestoreModule_ParamsSpec.$, null, impl.restoreModule.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class MicrosoftFilesPageHandler {
    static get $interfaceName() {
        return "file_suggestion.mojom.MicrosoftFilesPageHandler";
    }
    /**
     * 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 MicrosoftFilesPageHandlerRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the MicrosoftFilesPageHandler
 * 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 MicrosoftFilesPageHandlerCallbackRouter {
    helper_internal_;
    $;
    router_;
    getFiles;
    dismissModule;
    restoreModule;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(MicrosoftFilesPageHandlerRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.getFiles =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1951234855, MicrosoftFilesPageHandler_GetFiles_ParamsSpec.$, MicrosoftFilesPageHandler_GetFiles_ResponseParamsSpec.$, this.getFiles.createReceiverHandler(true /* expectsResponse */), false);
        this.dismissModule =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1943009901, MicrosoftFilesPageHandler_DismissModule_ParamsSpec.$, null, this.dismissModule.createReceiverHandler(false /* expectsResponse */), false);
        this.restoreModule =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1996872233, MicrosoftFilesPageHandler_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 MicrosoftFilesPageHandler_GetFiles_ParamsSpec = { $: {} };
export const MicrosoftFilesPageHandler_GetFiles_ResponseParamsSpec = { $: {} };
export const MicrosoftFilesPageHandler_DismissModule_ParamsSpec = { $: {} };
export const MicrosoftFilesPageHandler_RestoreModule_ParamsSpec = { $: {} };
mojo.internal.Struct(MicrosoftFilesPageHandler_GetFiles_ParamsSpec.$, 'MicrosoftFilesPageHandler_GetFiles_Params', [], [[0, 8],]);
mojo.internal.Struct(MicrosoftFilesPageHandler_GetFiles_ResponseParamsSpec.$, 'MicrosoftFilesPageHandler_GetFiles_ResponseParams', [
    mojo.internal.StructField('files', 0, 0, mojo.internal.Array(fileSuggestion_mojom_FileSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(MicrosoftFilesPageHandler_DismissModule_ParamsSpec.$, 'MicrosoftFilesPageHandler_DismissModule_Params', [], [[0, 8],]);
mojo.internal.Struct(MicrosoftFilesPageHandler_RestoreModule_ParamsSpec.$, 'MicrosoftFilesPageHandler_RestoreModule_Params', [], [[0, 8],]);
