import AsyncStorage from '@react-native-async-storage/async-storage'; const STORAGE_PREFIX = '@@expo@@'; /** * A mock implementation of the native kernel module that can be used when loading Home as a regular * project or when running it on web. * * Longer term, it may make sense to natively define a private, unprivileged implementation of the * kernel module and use this implementation only on web. */ export default { sdkVersions: '', async getDevMenuSettingsAsync(): Promise { return null; }, async setDevMenuSettingAsync(_key: string, _value: any): Promise {}, async doesCurrentTaskEnableDevtoolsAsync(): Promise { return false; }, async getDevMenuItemsToShowAsync(): Promise { return {}; }, async selectDevMenuItemWithKeyAsync(_key: string): Promise {}, async reloadAppAsync(): Promise {}, async closeDevMenuAsync(): Promise {}, async goToHomeAsync(): Promise {}, selectQRReader(): void {}, async getIsOnboardingFinishedAsync(): Promise { const item = await AsyncStorage.getItem(`${STORAGE_PREFIX}:onboarding`); return !!item; }, async setIsOnboardingFinishedAsync(finished: boolean): Promise { if (finished) { await AsyncStorage.setItem(`${STORAGE_PREFIX}:onboarding`, '1'); } else { await AsyncStorage.removeItem(`${STORAGE_PREFIX}:onboarding`); } }, async getSessionAsync(): Promise { const json = await AsyncStorage.getItem(`${STORAGE_PREFIX}:session`); return json ? JSON.parse(json) : null; }, async setSessionAsync(session: object): Promise { const json = JSON.stringify(session); await AsyncStorage.setItem(`${STORAGE_PREFIX}:session`, json); }, async removeSessionAsync(): Promise { await AsyncStorage.removeItem(`${STORAGE_PREFIX}:session`); }, onEventSuccess(_eventId: string, _result: object): void {}, onEventFailure(_eventId: string, _message: string): void {}, };