import { BaseService } from '../../services/abstract/baseService'; import { StorageItem } from './models/storageItem'; export declare enum LocalStorageKeys { apiKey = "Storyteller.apiKey", ampEnvironment = "Storyteller.ampEnvironment", ampVersion = "Storyteller.ampVersion", clipLikes = "Storyteller.clipLikes", clipShares = "Storyteller.clipShares", clipsViewed = "Storyteller.clipsViewed", customEnvironment = "Storyteller.customEnvironment", customInstanceHost = "Storyteller.customInstanceHost", environment = "Storyteller.environment", forceShowShareButton = "Storyteller.forceShowShareButton", hasShownInstructions = "Storyteller.hasShownInstructions", pollAnswerMap = "Storyteller.pollAnswerMap", polls = "Storyteller.polls", quizAnswerMap = "Storyteller.quizAnswerMap", quizAnsweredCorrectlyMap = "Storyteller.quizAnsweredCorrectlyMap", quizzes = "Storyteller.quizzes", recentStoryPlaybackMode = "Storyteller.recentStoryPlaybackMode", settings = "Storyteller.settings", storiesReadMap = "Storyteller.storiesReadMap", user = "Storyteller.user", userAttributes = "Storyteller.userAttributesStorage", userId = "Storyteller.userId", webSdkEnvironment = "Storyteller.webSdkEnvironment", webSdkVersion = "Storyteller.webSdkVersion" } declare class LocalStorageService extends BaseService { static sharedInstance: LocalStorageService; protected logTag: string; private localStorageSupported; private storage_; constructor(); hasItem(key: LocalStorageKeys): boolean; add(key: LocalStorageKeys, item: unknown): void; getAllItems(): StorageItem[]; getAllValues(): any[]; get(key: LocalStorageKeys): T | null; remove(key: LocalStorageKeys): void; clear(): void; private canKeyBeStored_; private isFallbackValueDefined_; private isLocalStorageValueDefined_; private onEventTrackingOptionsUpdated_; /** * In some cases, the values stored in local storage might get removed after Storyteller * is initialised, for example after a user interacts with a cookie banner. We keep track * of the important values in local memory and restore them if they are missing. * More details https://stormideas.atlassian.net/browse/ST-11121 */ private restoreIfUnavailable_; /** * See comment on restoreIfUnavailable_ function. */ private shouldValueHaveFallback_; } declare const _default: LocalStorageService; export default _default;