UNPKG

@zendesk/react-measure-timing-hooks

Version:

react hooks for measuring time to interactive and time to render of components

18 lines (17 loc) 911 B
import { ActionLog } from './ActionLog'; import type { UseActionLogCacheOptions } from './types'; export interface ActionLogRef<CustomMetadata extends Record<string, unknown> = Record<string, unknown>> { activeId: string; ids: Set<string>; actionLog: ActionLog<CustomMetadata>; getCurrent: (id: string) => ActionLog<CustomMetadata>; } export declare class ActionLogCache<CustomMetadata extends Record<string, unknown> = Record<string, unknown>> { private readonly options; private readonly cache; private garbageCollectUnusedIdLater; makeWrapperRef(actionLog: ActionLog<CustomMetadata>, initialId: string): ActionLogRef<CustomMetadata>; get(id: string): ActionLog<CustomMetadata> | undefined; makeGetOrCreateFn(id: string): (id: string) => ActionLog<CustomMetadata>; constructor({ garbageCollectMs, ...actionLogOptions }: UseActionLogCacheOptions<CustomMetadata>); }