@inchill/time-to-interactive
Version:
Easily measure performance metrics of time to interactive in JavaScript.
31 lines (30 loc) • 893 B
TypeScript
import { Metric } from '../types/index';
/**
* Performantly generate a unique, 30-char string by combining a version
* number, the current timestamp with a 13-digit number integer.
* @return {string}
*/
export declare const generateUniqueID: () => string;
export declare const initMetric: <MetricName extends "TTI">(name: MetricName, value?: number) => {
name: MetricName;
value: number;
rating: "good" | "needs-improvement" | "poor";
id: string;
};
/**
*
* @param value number
* @returns 'good' | 'needs-improvement' | 'poor'
*/
export declare const getRating: (value: number) => Metric['rating'];
/**
* Check if is's Safari browser.
* @returns boolean
*/
export declare function isSafari(): boolean;
/**
* Get the value of the specific search query key.
* @param name string
* @returns string
*/
export declare const getQueryString: (name?: string) => string;