Type AsyncStorage

Summary:
Types the AsyncStorage module with Flow.

Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D25884607

fbshipit-source-id: 7762ebfc68b87e6c5a0d8100fcc564f002061f5c
This commit is contained in:
Moti Zilberman
2021-01-12 11:14:27 -08:00
committed by Facebook GitHub Bot
parent c42a59af7e
commit 05e380f26c
5 changed files with 128 additions and 76 deletions
@@ -14,29 +14,32 @@ import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export interface Spec extends TurboModule {
+getConstants: () => {||};
+getConstants: () => {};
+multiGet: (
keys: Array<string>,
callback: (
errors: ?Array<{|message: string|}>,
errors: ?Array<{message: string, key?: string}>,
kvPairs: ?Array<Array<string>>,
) => void,
) => void;
+multiSet: (
kvPairs: Array<Array<string>>,
callback: (errors: ?Array<{|message: string|}>) => void,
callback: (errors: ?Array<{message: string, key?: string}>) => void,
) => void;
+multiMerge: (
kvPairs: Array<Array<string>>,
callback: (errors: ?Array<{|message: string|}>) => void,
callback: (errors: ?Array<{message: string, key?: string}>) => void,
) => void;
+multiRemove: (
keys: Array<string>,
callback: (errors: ?Array<{|message: string|}>) => void,
callback: (errors: ?Array<{message: string, key?: string}>) => void,
) => void;
+clear: (callback: (error: {|message: string|}) => void) => void;
+clear: (callback: (error: {message: string, key?: string}) => void) => void;
+getAllKeys: (
callback: (error: ?{|message: string|}, allKeys: ?Array<string>) => void,
callback: (
error: ?{message: string, key?: string},
allKeys: ?Array<string>,
) => void,
) => void;
}