// services/device/public/mojom/geolocation_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';
import { GeopositionResultSpec as device_mojom_GeopositionResultSpec } from './geoposition.mojom-webui.js';
import { TimeSpec as mojoBase_mojom_TimeSpec, TimeDeltaSpec as mojoBase_mojom_TimeDeltaSpec } from '//resources/mojo/mojo/public/mojom/base/time.mojom-webui.js';
export const INVALID_RADIO_SIGNAL_STRENGTH = -2147483648;
export const INVALID_CHANNEL = -2147483648;
export const INVALID_SIGNAL_TO_NOISE = -2147483648;
export const LocationProviderManagerModeSpec = { $: mojo.internal.Enum() };
export var LocationProviderManagerMode;
(function (LocationProviderManagerMode) {
    LocationProviderManagerMode[LocationProviderManagerMode["MIN_VALUE"] = 0] = "MIN_VALUE";
    LocationProviderManagerMode[LocationProviderManagerMode["MAX_VALUE"] = 5] = "MAX_VALUE";
    LocationProviderManagerMode[LocationProviderManagerMode["kNetworkOnly"] = 0] = "kNetworkOnly";
    LocationProviderManagerMode[LocationProviderManagerMode["kPlatformOnly"] = 1] = "kPlatformOnly";
    LocationProviderManagerMode[LocationProviderManagerMode["kCustomOnly"] = 2] = "kCustomOnly";
    LocationProviderManagerMode[LocationProviderManagerMode["kHybridPlatform"] = 3] = "kHybridPlatform";
    LocationProviderManagerMode[LocationProviderManagerMode["kHybridFallbackNetwork"] = 4] = "kHybridFallbackNetwork";
    LocationProviderManagerMode[LocationProviderManagerMode["kHybridPlatform2"] = 5] = "kHybridPlatform2";
})(LocationProviderManagerMode || (LocationProviderManagerMode = {}));
export class GeolocationInternalsObserverPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'device.mojom.GeolocationInternalsObserver', scope);
    }
}
export class GeolocationInternalsObserverRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(GeolocationInternalsObserverPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onDiagnosticsChanged(diagnostics) {
        this.proxy.sendMessage(2020159067, GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsSpec.$, null, [
            diagnostics
        ], false);
    }
    onNetworkLocationRequested(accessPointData) {
        this.proxy.sendMessage(1462902707, GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsSpec.$, null, [
            accessPointData
        ], false);
    }
    onNetworkLocationReceived(response) {
        this.proxy.sendMessage(2124594077, GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsSpec.$, null, [
            response
        ], false);
    }
}
;
/**
 * An object which receives request messages for the GeolocationInternalsObserver
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class GeolocationInternalsObserverReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GeolocationInternalsObserverRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(2020159067, GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsSpec.$, null, impl.onDiagnosticsChanged.bind(impl), false);
        this.helper_internal_.registerHandler(1462902707, GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsSpec.$, null, impl.onNetworkLocationRequested.bind(impl), false);
        this.helper_internal_.registerHandler(2124594077, GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsSpec.$, null, impl.onNetworkLocationReceived.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class GeolocationInternalsObserver {
    static get $interfaceName() {
        return "device.mojom.GeolocationInternalsObserver";
    }
    /**
     * 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 GeolocationInternalsObserverRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the GeolocationInternalsObserver
 * 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 GeolocationInternalsObserverCallbackRouter {
    helper_internal_;
    $;
    router_;
    onDiagnosticsChanged;
    onNetworkLocationRequested;
    onNetworkLocationReceived;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GeolocationInternalsObserverRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onDiagnosticsChanged =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2020159067, GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsSpec.$, null, this.onDiagnosticsChanged.createReceiverHandler(false /* expectsResponse */), false);
        this.onNetworkLocationRequested =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1462902707, GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsSpec.$, null, this.onNetworkLocationRequested.createReceiverHandler(false /* expectsResponse */), false);
        this.onNetworkLocationReceived =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2124594077, GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsSpec.$, null, this.onNetworkLocationReceived.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 class GeolocationInternalsPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'device.mojom.GeolocationInternals', scope);
    }
}
export class GeolocationInternalsRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(GeolocationInternalsPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    addInternalsObserver(observer) {
        return this.proxy.sendMessage(136335164, GeolocationInternals_AddInternalsObserver_ParamsSpec.$, GeolocationInternals_AddInternalsObserver_ResponseParamsSpec.$, [
            observer
        ], false);
    }
}
;
/**
 * An object which receives request messages for the GeolocationInternals
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class GeolocationInternalsReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GeolocationInternalsRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(136335164, GeolocationInternals_AddInternalsObserver_ParamsSpec.$, GeolocationInternals_AddInternalsObserver_ResponseParamsSpec.$, impl.addInternalsObserver.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class GeolocationInternals {
    static get $interfaceName() {
        return "device.mojom.GeolocationInternals";
    }
    /**
     * 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 GeolocationInternalsRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the GeolocationInternals
 * 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 GeolocationInternalsCallbackRouter {
    helper_internal_;
    $;
    router_;
    addInternalsObserver;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(GeolocationInternalsRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.addInternalsObserver =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(136335164, GeolocationInternals_AddInternalsObserver_ParamsSpec.$, GeolocationInternals_AddInternalsObserver_ResponseParamsSpec.$, this.addInternalsObserver.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 AccessPointDataSpec = { $: {} };
export const NetworkLocationDiagnosticsSpec = { $: {} };
export const PositionCacheDiagnosticsSpec = { $: {} };
export const WifiPollingPolicyDiagnosticsSpec = { $: {} };
export const GeolocationDiagnosticsSpec = { $: {} };
export const NetworkLocationResponseSpec = { $: {} };
export const GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsSpec = { $: {} };
export const GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsSpec = { $: {} };
export const GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsSpec = { $: {} };
export const GeolocationInternals_AddInternalsObserver_ParamsSpec = { $: {} };
export const GeolocationInternals_AddInternalsObserver_ResponseParamsSpec = { $: {} };
mojo.internal.Struct(AccessPointDataSpec.$, 'AccessPointData', [
    mojo.internal.StructField('macAddress', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('radioSignalStrength', 8, 0, mojo.internal.Int32, INVALID_RADIO_SIGNAL_STRENGTH, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('channel', 12, 0, mojo.internal.Int32, INVALID_CHANNEL, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('signalToNoise', 16, 0, mojo.internal.Int32, INVALID_SIGNAL_TO_NOISE, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('timestamp', 24, 0, mojoBase_mojom_TimeSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 40],]);
mojo.internal.Struct(NetworkLocationDiagnosticsSpec.$, 'NetworkLocationDiagnostics', [
    mojo.internal.StructField('accessPointData', 0, 0, mojo.internal.Array(AccessPointDataSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('wifiTimestamp', 8, 0, mojoBase_mojom_TimeSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(PositionCacheDiagnosticsSpec.$, 'PositionCacheDiagnostics', [
    mojo.internal.StructField('cacheSize', 0, 0, mojo.internal.Uint32, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('lastHit', 8, 0, mojoBase_mojom_TimeSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('lastMiss', 16, 0, mojoBase_mojom_TimeSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('hit_rate_$flag', 4, 0, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "hit_rate_$value",
        originalFieldName: "hitRate",
    }, undefined),
    mojo.internal.StructField('hit_rate_$value', 24, 0, mojo.internal.Double, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "hitRate",
    }, undefined),
    mojo.internal.StructField('lastNetworkResult', 32, 0, device_mojom_GeopositionResultSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 56],]);
mojo.internal.Struct(WifiPollingPolicyDiagnosticsSpec.$, 'WifiPollingPolicyDiagnostics', [
    mojo.internal.StructField('intervalStart', 0, 0, mojoBase_mojom_TimeSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('intervalDuration', 8, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('pollingInterval', 16, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('defaultInterval', 24, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('noChangeInterval', 32, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('twoNoChangeInterval', 40, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('noWifiInterval', 48, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 64],]);
export const GeolocationDiagnostics_ProviderStateSpec = { $: mojo.internal.Enum() };
export var GeolocationDiagnostics_ProviderState;
(function (GeolocationDiagnostics_ProviderState) {
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["MIN_VALUE"] = 0] = "MIN_VALUE";
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["MAX_VALUE"] = 3] = "MAX_VALUE";
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["kStopped"] = 0] = "kStopped";
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["kHighAccuracy"] = 1] = "kHighAccuracy";
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["kLowAccuracy"] = 2] = "kLowAccuracy";
    GeolocationDiagnostics_ProviderState[GeolocationDiagnostics_ProviderState["kBlockedBySystemPermission"] = 3] = "kBlockedBySystemPermission";
})(GeolocationDiagnostics_ProviderState || (GeolocationDiagnostics_ProviderState = {}));
mojo.internal.Struct(GeolocationDiagnosticsSpec.$, 'GeolocationDiagnostics', [
    mojo.internal.StructField('providerState', 0, 0, GeolocationDiagnostics_ProviderStateSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('networkLocationDiagnostics', 8, 0, NetworkLocationDiagnosticsSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('positionCacheDiagnostics', 16, 0, PositionCacheDiagnosticsSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('wifiPollingPolicyDiagnostics', 24, 0, WifiPollingPolicyDiagnosticsSpec.$, null, true /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('location_provider_manager_mode_$flag', 4, 0, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "location_provider_manager_mode_$value",
        originalFieldName: "locationProviderManagerMode",
    }, undefined),
    mojo.internal.StructField('location_provider_manager_mode_$value', 32, 0, LocationProviderManagerModeSpec.$, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "locationProviderManagerMode",
    }, undefined),
], [[0, 48],]);
mojo.internal.Struct(NetworkLocationResponseSpec.$, 'NetworkLocationResponse', [
    mojo.internal.StructField('latitude', 0, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('longitude', 8, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('accuracy_$flag', 16, 0, mojo.internal.Bool, false, false /* nullable */, 0, {
        isPrimary: true,
        linkedValueFieldName: "accuracy_$value",
        originalFieldName: "accuracy",
    }, undefined),
    mojo.internal.StructField('accuracy_$value', 24, 0, mojo.internal.Double, 0, false /* nullable */, 0, {
        isPrimary: false,
        originalFieldName: "accuracy",
    }, undefined),
], [[0, 40],]);
mojo.internal.Struct(GeolocationInternalsObserver_OnDiagnosticsChanged_ParamsSpec.$, 'GeolocationInternalsObserver_OnDiagnosticsChanged_Params', [
    mojo.internal.StructField('diagnostics', 0, 0, GeolocationDiagnosticsSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GeolocationInternalsObserver_OnNetworkLocationRequested_ParamsSpec.$, 'GeolocationInternalsObserver_OnNetworkLocationRequested_Params', [
    mojo.internal.StructField('accessPointData', 0, 0, mojo.internal.Array(AccessPointDataSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GeolocationInternalsObserver_OnNetworkLocationReceived_ParamsSpec.$, 'GeolocationInternalsObserver_OnNetworkLocationReceived_Params', [
    mojo.internal.StructField('response', 0, 0, NetworkLocationResponseSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GeolocationInternals_AddInternalsObserver_ParamsSpec.$, 'GeolocationInternals_AddInternalsObserver_Params', [
    mojo.internal.StructField('observer', 0, 0, mojo.internal.InterfaceProxy(GeolocationInternalsObserverRemote), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(GeolocationInternals_AddInternalsObserver_ResponseParamsSpec.$, 'GeolocationInternals_AddInternalsObserver_ResponseParams', [
    mojo.internal.StructField('diagnostics', 0, 0, GeolocationDiagnosticsSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
