Skip to content

Commit

Permalink
ZulipAsyncStorage types [nfc]: Add a quick annotation, for types-first.
Browse files Browse the repository at this point in the history
Related: zulip#4907
  • Loading branch information
chrisbobbe committed Aug 27, 2021
1 parent 88b0a71 commit d5e54ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/boot/ZulipAsyncStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | null> {
const item = await AsyncStorage.getItem(key);

// It's possible that getItem() is called on uncompressed state, for
Expand Down Expand Up @@ -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<mixed> {
return AsyncStorage.setItem(
key,
NativeModules.TextCompressionModule
Expand All @@ -55,7 +55,7 @@ export default class ZulipAsyncStorage {
);
}

static async multiSet(keyValuePairs: Array<Array<string>>) {
static async multiSet(keyValuePairs: Array<Array<string>>): Promise<mixed> {
return AsyncStorage.multiSet(
NativeModules.TextCompressionModule
? await Promise.all(
Expand 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;
}

0 comments on commit d5e54ce

Please sign in to comment.