UNPKG

react-unique-id-generator

Version:

A lightweight, zero-dependency library for generating unique, sequential IDs in React — with hooks, custom prefix/suffix, SSR support, and stable CSS selector generation

27 lines 3.29 kB
import nextId, { resetId, setGlobalPrefix, setGlobalSuffix, getCurrentId, setId, generateId, OVERFLOW_THRESHOLD } from "./nextId"; import { useUniqueId, useUniqueIds } from "./hooks"; import { IdProvider, IdContext, useIdContext } from "./context"; import type { IdProviderProps, IdContextValue } from "./context"; import { createServerIdManager } from "./server"; import type { ServerIdManager, ServerIdManagerOptions } from "./server"; import { generateAutomationId, useAutomationId, resetAutomationCounter, AutomationIdPool } from "./automation"; import type { AutomationIdStrategy, AutomationIdOptions } from "./automation"; import { generateSecureId } from "./secure"; import { nextIdForScope, resetIdForScope, resetAllScopes, getScopeCounter, getActiveScopes } from "./scope"; import { useTrackedUniqueId, useTrackedUniqueIds, useIdMetrics, getIdMetrics, resetIdMetrics, getActiveIdCount, cleanupInactiveIds } from "./performance"; import type { IdMetrics } from "./performance"; import { generateIdWithStrategy, useIdWithStrategy, numericStrategy, zeroPaddedStrategy, timestampStrategy, hashStrategy, resetStrategyCounter, getStrategyCounter } from "./strategy"; import type { IdStrategy } from "./strategy"; import { CollisionDetector, getGlobalCollisionDetector, resetGlobalCollisionDetector, checkCollision } from "./collision"; import type { CollisionAction, CollisionDetectorOptions } from "./collision"; import { IdPool, useIdPool } from "./pool"; import type { IdPoolOptions } from "./pool"; import { SSRProvider, SSRContext, useSSRContext, useSSRSafeId, createSSRIdFactory } from "./ssr"; import type { SSRContextValue, SSRProviderProps } from "./ssr"; import { generateDelimitedId, useDelimitedId, resetDelimiterCounter, getDelimiterCounter } from "./delimiter"; import type { DelimitedIdOptions } from "./delimiter"; import { generateSelector, useStableSelector, resetSelectorCache } from "./selector"; import type { SelectorOptions } from "./selector"; export { nextId as default, resetId, setGlobalPrefix, setGlobalSuffix, getCurrentId, setId, generateId, OVERFLOW_THRESHOLD, useUniqueId, useUniqueIds, IdProvider, IdContext, useIdContext, createServerIdManager, generateAutomationId, useAutomationId, resetAutomationCounter, AutomationIdPool, generateSecureId, nextIdForScope, resetIdForScope, resetAllScopes, getScopeCounter, getActiveScopes, useTrackedUniqueId, useTrackedUniqueIds, useIdMetrics, getIdMetrics, resetIdMetrics, getActiveIdCount, cleanupInactiveIds, generateIdWithStrategy, useIdWithStrategy, numericStrategy, zeroPaddedStrategy, timestampStrategy, hashStrategy, resetStrategyCounter, getStrategyCounter, CollisionDetector, getGlobalCollisionDetector, resetGlobalCollisionDetector, checkCollision, IdPool, useIdPool, SSRProvider, SSRContext, useSSRContext, useSSRSafeId, createSSRIdFactory, generateDelimitedId, useDelimitedId, resetDelimiterCounter, getDelimiterCounter, generateSelector, useStableSelector, resetSelectorCache, }; export type { IdProviderProps, IdContextValue, ServerIdManager, ServerIdManagerOptions, AutomationIdStrategy, AutomationIdOptions, IdMetrics, IdStrategy, CollisionAction, CollisionDetectorOptions, IdPoolOptions, SSRContextValue, SSRProviderProps, DelimitedIdOptions, SelectorOptions, }; //# sourceMappingURL=index.d.ts.map