From d5e54cef1d7a1aea70169406371db07aa3163346 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Fri, 27 Aug 2021 16:35:28 -0700 Subject: [PATCH] ZulipAsyncStorage types [nfc]: Add a quick annotation, for types-first. Related: #4907 --- src/boot/ZulipAsyncStorage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/boot/ZulipAsyncStorage.js b/src/boot/ZulipAsyncStorage.js index 17917223876..386b7f4c982 100644 --- a/src/boot/ZulipAsyncStorage.js +++ b/src/boot/ZulipAsyncStorage.js @@ -4,7 +4,7 @@ import { NativeModules } from 'react-native'; import * as logging from '../utils/logging'; export default class ZulipAsyncStorage { - static async getItem(key: string) { + static async getItem(key: string): Promise { const item = await AsyncStorage.getItem(key); // It's possible that getItem() is called on uncompressed state, for @@ -46,7 +46,7 @@ export default class ZulipAsyncStorage { return item; } - static async setItem(key: string, value: string) { + static async setItem(key: string, value: string): Promise { return AsyncStorage.setItem( key, NativeModules.TextCompressionModule @@ -55,7 +55,7 @@ export default class ZulipAsyncStorage { ); } - static async multiSet(keyValuePairs: Array>) { + static async multiSet(keyValuePairs: Array>): Promise { return AsyncStorage.multiSet( NativeModules.TextCompressionModule ? await Promise.all( @@ -68,9 +68,9 @@ export default class ZulipAsyncStorage { ); } - static removeItem = AsyncStorage.removeItem; + static removeItem: typeof AsyncStorage.removeItem = AsyncStorage.removeItem; - static getAllKeys = AsyncStorage.getAllKeys; + static getAllKeys: typeof AsyncStorage.getAllKeys = AsyncStorage.getAllKeys; - static clear = AsyncStorage.clear; + static clear: typeof AsyncStorage.clear = AsyncStorage.clear; }