import type { AppMenuCategory } from "./types.js"; /** A single row from the articles data object backing the app list. */ export type AppMenuArticle = { ArticleId: string; Title: string | null; MenuGroup: string | null; Path: string | null; IsFavorite?: boolean | null; }; /** Sentinel group key for apps that have no MenuGroup set. */ export declare const UNGROUPED = "\0ungrouped"; /** Sentinel group key for the virtual group holding the user's favorites. */ export declare const FAVORITES = "\0favorites"; /** Strip version suffixes (`my-app.0000012`) from an ArticleId. */ export declare function stripVersionSuffix(articleId: string): string; export type AppEntry = { id: string; title: string; group: string; href: string; isFavorite: boolean; }; /** The category currently selected in the rail. `null` means "all applications". */ export type Selection = { type: "group"; key: string; } | { type: "category"; id: string; } | null; /** * Normalize the raw article rows into a deduplicated, sorted list of apps. * * `aviw_WebShared_Articles` contains one row per published article version, so * the same app can appear dozens of times. Deduplicating on the version-less * ArticleId guarantees a single entry per app even if the data object's where * clause is relaxed. */ export declare function toAppEntries(articles: readonly AppMenuArticle[]): AppEntry[]; /** * Group entries by group key. The favorites are a virtual group listed first, * and ungrouped apps are always listed last. */ export declare function groupEntries(entries: readonly AppEntry[]): [string, AppEntry[]][]; /** Human readable title for a group key, resolving the sentinel keys. */ export declare function groupLabel(group: string): string; /** Drop entries that don't match the search term, then empty groups. */ export declare function filterCategory(category: AppMenuCategory, term: string): AppMenuCategory; export declare function countItems(category: AppMenuCategory): number; /** Split the categories into their rail sections, preserving the given order. */ export declare function toRailSections(categories: readonly AppMenuCategory[]): [string, AppMenuCategory[]][];