@zendesk/react-measure-timing-hooks
Version:
react hooks for measuring time to interactive and time to render of components
16 lines (15 loc) • 983 B
TypeScript
/**
* Create a function to calculate the dynamic quiet window duration based on configurable decay points.
* @param {Object} params - The parameters for the quiet window duration calculation.
* @param {number} [params.D0=INITIAL_QUIET_WINDOW_SIZE] - Desired quiet window duration at FMP (in milliseconds).
* @param {number} [params.Dx=QUITE_WINDOW_SIZE_AT_X] - Desired quiet window duration at x seconds after FMP (in milliseconds).
* @param {number} [params.x=X_SECONDS] - Time in seconds after FMP for which Dx is specified.
* @param {number} [params.DInfinity=MINIMUM_QUIET_WINDOW_SIZE] - Desired asymptotic quiet window duration (in milliseconds).
* @returns A function that calculates the quiet window duration based on the current time and FMP.
*/
export declare const createQuietWindowDurationCalculator: ({ D0, Dx, x, DInfinity, }?: {
D0?: number;
Dx?: number;
x?: number;
DInfinity?: number;
}) => (nowTime: number, referenceTime: number) => number;