import UniqueViewIdStorageOptions from './UniqueViewIdStorageOptions.js'; /** * A localStorage wrapper which contains logic to manage Omnitracking's unique view * ids lifetime. */ declare class UniqueViewIdStorage { private config; /** * Creates an instance of the storage with the passed configuration. * * @param config - Config parameters. */ constructor(config?: UniqueViewIdStorageOptions); /** * Gets the unique view id associated with the url received on the key argument * from localStorage or null if not found/expired/does not support localStorage. * * @param key - The url string to retrieve the unique view id from. * * @returns - The associated unique view id for the key or null if not found/expired/does not support * localStorage. */ get(key: string): string | null; /** * Sets the unique view id value of the url key in localStorage, if supported. Will * remove oldest entries if items limit has been reached in order to accommodate * the new entry. * * @param key - The url to save the unique view id value. * @param value - The unique view id to save. * * @returns True if item was saved in localStorage, false otherwise. */ set(key: string, value: string): boolean; /** * Removes expired entries in localStorage. */ removeExpired(): void; /** * Removes oldest item from localStorage, if found. */ removeOldestItem(): void; /** * Checks if the currently unique view id items stored in localStorage have hit the * limit specified in config. * * @returns True if the max limit of items stored in localStorage is greater or equal than the maxItems * config. */ hasLimitReached(): boolean; /** * Check if a url key entry in localStorage has expired. * * @param key - The url key to check. * * @returns True if the expires time of the entry has been reached, false otherwise. */ isExpired(key: string): boolean; /** * Auxiliary method used by set method to store the entry in localStorage. * * @param key - The url key to save the unique view id value. * @param value - The unique view id value for the url key. */ setItem(key: string, value: string): void; /** * Removes an item from localStorage. * * @param key - The url key to remove. */ removeItem(key: string): void; /** * Checks if the runtime environment supports localStorage. * * @returns True if localStorage is supported, false otherwise. */ supportsLocalStorage(): boolean; /** * Clears all UniqueViewId items from localStorage. */ clear(): void; } export default UniqueViewIdStorage;