/** * Use web worker to execute fn on other thread * reference: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API * * @param executeFn * function to execute * inside the function can call self.postMessage(data) to emit data * * @param callback * callback.fn will be execute when [executeFn] emit data * * @param workerTimeout * timeout in milliseconds for worker to terminate * * ! remember to terminate worker * if no callback is provider or callback.terminateAfterCallback set to false, * Not terminate worker will not release browser/computed resource */ declare function startWebworker(executeFn: () => void, callback?: { fn: (data: unknown, worker: Worker) => void; terminateAfterCallback: boolean; }, timeout?: number): Worker; /** * Storage key will be used as key in LocalStorage * Beware when changing value ! */ type StorageKey = "feedme_locale" | "feedme_country" | "feedme_business" | "feedme_restaurant"; declare const localStorage: { get(key: StorageKey, fallback?: string): string | undefined; set(key: StorageKey, value: string): void; remove(key: StorageKey): void; }; export { localStorage, startWebworker };