/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ /** * Ranked-row rendering shared by the dashboard cards and the full-list * modal, plus the small pure helpers both rely on. */ import type React from 'react'; export type AnalyticsTone = 'views' | 'visitors' | 'downloads'; export interface RankedRow { key: string; label: string; value: number; visitors: number; overflow: boolean; } /** A complete ranking plus the size of the set it was drawn from. */ export interface RankedListSource { rows: RankedRow[]; total: number; } /** The ordered list with a share bar behind each row. Renders no card chrome. */ export declare function RankingRows({ rows, tone, locale, }: { rows: RankedRow[]; tone: AnalyticsTone; locale: string; }): React.JSX.Element; /** Never collapse the bar entirely: a visible sliver still encodes "smallest". */ export declare function shareWidth(value: number, ceiling: number): number; /** Row indices for one page of a list, with the page clamped into range. */ export declare function pageWindow(total: number, pageSize: number, page: number): { start: number; end: number; pageCount: number; }; /** * Localised region name for an ISO 3166-1 alpha-2 code, or the code itself * when the value is not a code or the runtime has no name for it. The * dashboard stores bare codes, so this is purely a display concern. */ export declare function regionName(code: string, locale: string): string;