/** * 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 */ import type React from 'react'; import type { AnalyticsPathTotal, AnalyticsRankedTotals, AnalyticsReferrerTotal } from '@byline/analytics'; import type { AnalyticsDashboardData, AnalyticsDashboardPeriod } from '../types.js'; export { shareWidth } from './ranking.js'; /** Rows each ranked card shows before offering the full list. */ export declare const ANALYTICS_PREVIEW_ROWS = 10; /** The truncated lists a host can fetch in full on demand. */ export type AnalyticsFullListKind = 'pages' | 'downloads' | 'referrers'; export interface AnalyticsDashboardProps { data: AnalyticsDashboardData; period: AnalyticsDashboardPeriod; onPeriodChange(period: AnalyticsDashboardPeriod): void; /** * Fetch a larger top-N for one of the truncated lists when its "View all" * modal opens. Countries are always complete and never use this. Omit it * and those cards still show their preview, without the action. */ loadFullList?(kind: AnalyticsFullListKind): Promise>; } export declare function AnalyticsDashboard({ data, period, onPeriodChange, loadFullList, }: AnalyticsDashboardProps): React.JSX.Element; export declare function formatShare(part: number, whole: number, locale: string): string; /** Return the retained boundary only when it truncates the selected range. */ export declare function partialCoverageFrom(rangeFrom: string, coverageFrom: string | null): string | undefined;