import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
import { DataListViewType } from '../../lib/data-list-view.js';
import { OpenTablePropertiesHandle } from '../../lib/list-page-table-properties.js';
import { RowHeight } from '../../lib/row-height.js';
import '../../data-list-view-registry-BstmlfQ3.js';

type ViewType = DataListViewType;
/** Same labels/icons as Properties drawer `SelectionTileGrid` — single source in `DATA_LIST_VIEW_TILES`. */
declare const VIEW_TYPES: {
    type: ViewType;
    label: string;
    icon: string;
}[];
interface FilterOption {
    id: string;
    label: string;
}
interface ViewTab {
    id: string;
    label: string;
    viewType: ViewType;
    icon: string;
    /** Optional filter key for lifecycle or category-based filtering */
    filterId: string;
    /**
     * Per-view row density preference captured at creation time (or later via
     * Properties). Consumers that render tables/boards can read this to set the
     * initial `rowHeight` for that specific view tab.
     */
    rowHeight?: RowHeight;
}
interface ListPageTemplateProps {
    /** Page header — rendered above metrics */
    header: React.ReactNode;
    /** Optional metrics strip — rendered below header */
    metrics?: React.ReactNode;
    /** Whether to show metrics (controlled externally) */
    showMetrics?: boolean;
    /** Initial tabs (uncontrolled mode) */
    defaultTabs: ViewTab[];
    /**
     * Controlled tabs — when all four are provided, tab state is owned by the parent
     * (e.g. for localStorage). Otherwise `defaultTabs` + internal state are used.
     */
    tabs?: ViewTab[];
    onTabsChange?: (tabs: ViewTab[]) => void;
    activeTabId?: string;
    onActiveTabChange?: (id: string) => void;
    /** Filter options per tab (e.g. All, Upcoming, Ongoing, Completed) */
    filterOptions?: FilterOption[];
    /** Label for the filter sub-menu (default: "Filter") */
    filterLabel?: string;
    /** Get count for a tab's filter (for badge) */
    getTabCount?: (filterId: string) => number;
    /** Render the content for the active tab */
    renderContent: (tab: ViewTab, updateTab: (patch: Partial<ViewTab>) => void) => React.ReactNode;
    /** Export drawer props */
    exportOpen?: boolean;
    onExportOpenChange?: (open: boolean) => void;
    /** Row count for export; if omitted, uses `getTabCount(activeTab.filterId)` when provided */
    exportTotalRows?: number;
    /**
     * Tab menu — “Edit” (e.g. open table properties). Parent can switch to table view first, then call ref.
     * Overrides `tablePropertiesRef` when both are set.
     */
    onEditView?: (tab: ViewTab, helpers: {
        updateTab: (patch: Partial<ViewTab>) => void;
    }) => void;
    /**
     * Ref to the active tab’s table surface (`openPropertiesDrawer`). Wires “View → Edit” to
     * `TablePropertiesDrawer` when `onEditView` is omitted.
     */
    tablePropertiesRef?: React.RefObject<OpenTablePropertiesHandle | null>;
    /** When true, hide the views tab strip (tabs + add view) — e.g. search landing with a single table surface. */
    hideViewsToolbar?: boolean;
    /**
     * Subset of view types the hub actually implements (e.g. List hub omits Dashboard/Folder).
     * When set, the Add view menu and ⌘1–9 shortcuts are filtered so users cannot add a view the
     * hub cannot render. When omitted, defaults to {@link FULL_HUB_SUPPORTED_VIEWS}
     * (table, list, board, dashboard). Pass an explicit allowlist for specialized hubs
     * (e.g. tokens table-only, library with folder/calendar).
     *
     * Pair with `TablePropertiesDrawerButton.supportedViewTypes` to keep Properties consistent.
     */
    supportedViewTypes?: readonly DataListViewType[];
    /**
     * **Opt-in localStorage persistence** for the page-level state: the
     * user's view tabs (their labels, view types, icons, filterIds) and the
     * currently active tab. When set, returning to the hub restores the
     * tab arrangement.
     *
     * Storage keys: `exxat-ds:<persistKey>:listpage:tabs:v1` and
     * `exxat-ds:<persistKey>:listpage:active-tab:v1`. **Use the same key
     * across renders** of the same hub or persistence will reset.
     *
     * When `tabs` / `activeTabId` are also passed in controlled mode, the
     * controlled props win — `persistKey` is ignored. Most hubs SHOULD pick
     * one or the other.
     *
     * @see `apps/web/docs/persisted-state-pattern.md`
     * @see `.cursor/rules/exxat-persisted-state.mdc`
     */
    persistKey?: string;
    /**
     * Whether count badges should be shown in the view tab bar.
     * This is a **hub-level** preference (affects all tabs).
     * When `persistKey` is provided and the prop is not controlled, the value
     * is persisted under `<persistKey>:listpage:show-view-counts:v1`.
     */
    showViewCounts?: boolean;
    onShowViewCountsChange?: (show: boolean) => void;
    /**
     * Called when the user selects a view type from the "Add view" picker.
     * The parent (HubTable / LibraryTable) is expected to open
     * `TablePropertiesDrawer` in creation mode (`isCreatingNewView`) for that type,
     * allowing the user to set name + relevant initial view settings before the
     * tab is actually created.
     */
    onRequestCreateView?: (type: ViewType) => void;
}
declare function ListPageTemplate({ header, metrics, showMetrics, defaultTabs, tabs: tabsProp, onTabsChange, activeTabId: activeTabIdProp, onActiveTabChange, getTabCount, renderContent, exportOpen, onExportOpenChange, exportTotalRows, onEditView, tablePropertiesRef, hideViewsToolbar, supportedViewTypes, persistKey, showViewCounts: showViewCountsProp, onShowViewCountsChange, onRequestCreateView, }: ListPageTemplateProps): react_jsx_runtime.JSX.Element;

export { type FilterOption, ListPageTemplate, type ListPageTemplateProps, VIEW_TYPES, type ViewTab, type ViewType };
