// components/browser_apis/tab_strip/tab_strip_api_data_model.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 { ColorSpec as tabGroups_mojom_ColorSpec } from './tab_group_types.mojom-webui.js';
import { NodeIdSpec as tabsApi_mojom_NodeIdSpec, PositionSpec as tabsApi_mojom_PositionSpec } from './tab_strip_api_types.mojom-webui.js';
import { TabAlertStateSpec as tabs_mojom_TabAlertStateSpec, TabNetworkStateSpec as tabs_mojom_TabNetworkStateSpec } from './tabs.mojom-webui.js';
import { UrlSpec as url_mojom_UrlSpec } from '//resources/mojo/url/mojom/url.mojom-webui.js';
export const ImageSpec = { $: {} };
export const TabSpec = { $: {} };
export const WindowSpec = { $: {} };
export const TabStripSpec = { $: {} };
export const PinnedTabsSpec = { $: {} };
export const UnpinnedTabsSpec = { $: {} };
export const TabGroupSpec = { $: {} };
export const TabGroupVisualDataSpec = { $: {} };
export const SplitTabSpec = { $: {} };
export const SplitTabVisualDataSpec = { $: {} };
export const ContainerSpec = { $: {} };
export const TabCreatedContainerSpec = { $: {} };
export const DataSpec = { $: {} };
mojo.internal.Struct(ImageSpec.$, 'Image', [
    mojo.internal.StructField('dataUrl', 0, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(TabSpec.$, 'Tab', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('title', 8, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('url', 16, 0, url_mojom_UrlSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('favicon', 24, 0, ImageSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('alertStates', 32, 0, mojo.internal.Array(tabs_mojom_TabAlertStateSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('networkState', 40, 0, tabs_mojom_TabNetworkStateSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isActive', 44, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isSelected', 44, 1, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isBlocked', 44, 2, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 56],]);
mojo.internal.Struct(WindowSpec.$, 'Window', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(TabStripSpec.$, 'TabStrip', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PinnedTabsSpec.$, 'PinnedTabs', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(UnpinnedTabsSpec.$, 'UnpinnedTabs', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(TabGroupSpec.$, 'TabGroup', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('data', 8, 0, TabGroupVisualDataSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(TabGroupVisualDataSpec.$, 'TabGroupVisualData', [
    mojo.internal.StructField('title', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('color', 8, 0, tabGroups_mojom_ColorSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('isCollapsed', 12, 0, mojo.internal.Bool, false, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(SplitTabSpec.$, 'SplitTab', [
    mojo.internal.StructField('id', 0, 0, tabsApi_mojom_NodeIdSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('data', 8, 0, SplitTabVisualDataSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
export const SplitTabVisualData_LayoutSpec = { $: mojo.internal.Enum() };
export var SplitTabVisualData_Layout;
(function (SplitTabVisualData_Layout) {
    SplitTabVisualData_Layout[SplitTabVisualData_Layout["MIN_VALUE"] = 0] = "MIN_VALUE";
    SplitTabVisualData_Layout[SplitTabVisualData_Layout["MAX_VALUE"] = 1] = "MAX_VALUE";
    SplitTabVisualData_Layout[SplitTabVisualData_Layout["kSideBySide"] = 0] = "kSideBySide";
    SplitTabVisualData_Layout[SplitTabVisualData_Layout["kStacked"] = 1] = "kStacked";
})(SplitTabVisualData_Layout || (SplitTabVisualData_Layout = {}));
mojo.internal.Struct(SplitTabVisualDataSpec.$, 'SplitTabVisualData', [
    mojo.internal.StructField('layout', 0, 0, SplitTabVisualData_LayoutSpec.$, 0, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('splitRatio', 8, 0, mojo.internal.Double, 0, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(ContainerSpec.$, 'Container', [
    mojo.internal.StructField('data', 0, 0, DataSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('children', 16, 0, mojo.internal.Array(ContainerSpec.$, false), null, false /* nullable */, 0, undefined, undefined),
], [[0, 32],]);
mojo.internal.Struct(TabCreatedContainerSpec.$, 'TabCreatedContainer', [
    mojo.internal.StructField('tab', 0, 0, TabSpec.$, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('position', 8, 0, tabsApi_mojom_PositionSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Union(DataSpec.$, 'Data', {
    'tab': {
        'ordinal': 0,
        'type': TabSpec.$,
    },
    'tabStrip': {
        'ordinal': 1,
        'type': TabStripSpec.$,
    },
    'pinnedTabs': {
        'ordinal': 2,
        'type': PinnedTabsSpec.$,
    },
    'unpinnedTabs': {
        'ordinal': 3,
        'type': UnpinnedTabsSpec.$,
    },
    'tabGroup': {
        'ordinal': 4,
        'type': TabGroupSpec.$,
    },
    'splitTab': {
        'ordinal': 5,
        'type': SplitTabSpec.$,
    },
    'window': {
        'ordinal': 6,
        'type': WindowSpec.$,
    },
});
export var DataFieldTags;
(function (DataFieldTags) {
    DataFieldTags[DataFieldTags["TAB"] = 0] = "TAB";
    DataFieldTags[DataFieldTags["TAB_STRIP"] = 1] = "TAB_STRIP";
    DataFieldTags[DataFieldTags["PINNED_TABS"] = 2] = "PINNED_TABS";
    DataFieldTags[DataFieldTags["UNPINNED_TABS"] = 3] = "UNPINNED_TABS";
    DataFieldTags[DataFieldTags["TAB_GROUP"] = 4] = "TAB_GROUP";
    DataFieldTags[DataFieldTags["SPLIT_TAB"] = 5] = "SPLIT_TAB";
    DataFieldTags[DataFieldTags["WINDOW"] = 6] = "WINDOW";
})(DataFieldTags || (DataFieldTags = {}));
export function whichData(u) {
    if (u.tab !== null && u.tab !== undefined) {
        return DataFieldTags.TAB;
    }
    if (u.tabStrip !== null && u.tabStrip !== undefined) {
        return DataFieldTags.TAB_STRIP;
    }
    if (u.pinnedTabs !== null && u.pinnedTabs !== undefined) {
        return DataFieldTags.PINNED_TABS;
    }
    if (u.unpinnedTabs !== null && u.unpinnedTabs !== undefined) {
        return DataFieldTags.UNPINNED_TABS;
    }
    if (u.tabGroup !== null && u.tabGroup !== undefined) {
        return DataFieldTags.TAB_GROUP;
    }
    if (u.splitTab !== null && u.splitTab !== undefined) {
        return DataFieldTags.SPLIT_TAB;
    }
    if (u.window !== null && u.window !== undefined) {
        return DataFieldTags.WINDOW;
    }
    throw new Error("no union field has been set, this is an illegal state");
}
