/**
 * @typedef {Object<string,any>} Result
 * @typedef {import('web-vitals').Metric | Object<string,any>} Metric
 * @typedef {{ effectiveType: 'slow-2g' | '2g' | '3g' | '4g', rtt: number, downlink: number }} NetworkInformation
 *
 * @typedef {object} CreateApiReporterOptions
 * @prop {object} [initial]
 * @prop {(metric: Metric, result: Result) => Result} [mapMetric]
 * @prop {(result: Result) => Result | void} [beforeSend]
 * @prop {(url: string, result: Result) => any} [onSend]
 */
/**
 * Create Web Vitals API reporter, that accepts `Metric` values and sends it to `url`
 * using `navigator.sendBeacon` when available or fallbacks back to XMLHttpRequest.
 *
 * The function sends request only once.
 * Use `onSend` to implement a custom logic.
 *
 * @param {string} url
 * @param {CreateApiReporterOptions} [opts]
 * @return {(metric: Metric) => void}
 */
export function createApiReporter(url: string, opts?: CreateApiReporterOptions): (metric: Metric) => void;
/**
 * Get device information.
 * - Effective connection type: https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation
 * - Device memory: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory
 */
export function getDeviceInfo(): {
    url: string;
    referrer: string;
    userAgent: string;
    memory: number;
    cpus: number;
    connection: {
        effectiveType: "slow-2g" | "2g" | "3g" | "4g";
        rtt: number;
        downlink: number;
    };
};
export type Result = {
    [x: string]: any;
};
export type Metric = import("web-vitals").Metric | {
    [x: string]: any;
};
export type NetworkInformation = {
    effectiveType: 'slow-2g' | '2g' | '3g' | '4g';
    rtt: number;
    downlink: number;
};
export type CreateApiReporterOptions = {
    initial?: object;
    mapMetric?: (metric: Metric, result: Result) => Result;
    beforeSend?: (result: Result) => Result | void;
    onSend?: (url: string, result: Result) => any;
};
