@fto-consult/expo-ui 6.37.3 → 6.37.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/.package-lock.json +26218 -26188
- package/node_modules/@react-native-async-storage/async-storage/LICENSE +21 -0
- package/node_modules/@react-native-async-storage/async-storage/README.md +27 -0
- package/node_modules/@react-native-async-storage/async-storage/RNCAsyncStorage.podspec +19 -0
- package/node_modules/@react-native-async-storage/async-storage/android/build.gradle +142 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/AndroidManifest.xml +6 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java +178 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageErrorUtil.java +45 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageExpoMigration.java +154 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java +424 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java +58 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/ReactDatabaseSupplier.java +163 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/SerialExecutor.java +40 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt +86 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ErrorHelpers.kt +39 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageModule.kt +90 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +161 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/test/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpersTest.kt +93 -0
- package/node_modules/@react-native-async-storage/async-storage/android/src/test/java/com/reactnativecommunity/asyncstorage/next/StorageTest.kt +141 -0
- package/node_modules/@react-native-async-storage/async-storage/android/testresults.gradle +38 -0
- package/node_modules/@react-native-async-storage/async-storage/ios/RNCAsyncStorage.h +51 -0
- package/node_modules/@react-native-async-storage/async-storage/ios/RNCAsyncStorage.m +898 -0
- package/node_modules/@react-native-async-storage/async-storage/ios/RNCAsyncStorage.xcodeproj/project.pbxproj +283 -0
- package/node_modules/@react-native-async-storage/async-storage/ios/RNCAsyncStorageDelegate.h +73 -0
- package/node_modules/@react-native-async-storage/async-storage/jest/async-storage-mock.d.ts +9 -0
- package/node_modules/@react-native-async-storage/async-storage/jest/async-storage-mock.js +109 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js +164 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.native.js +366 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/AsyncStorage.native.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/RCTAsyncStorage.js +30 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/RCTAsyncStorage.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/helpers.js +69 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/helpers.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/hooks.js +44 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/hooks.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/index.js +22 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/index.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/shouldFallbackToLegacyNativeModule.js +39 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/shouldFallbackToLegacyNativeModule.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/types.js +2 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/commonjs/types.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.js +153 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.native.js +348 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.native.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/RCTAsyncStorage.js +20 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/RCTAsyncStorage.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/helpers.js +56 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/helpers.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/hooks.js +34 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/hooks.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/index.js +4 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/index.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/shouldFallbackToLegacyNativeModule.js +31 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/shouldFallbackToLegacyNativeModule.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/types.js +2 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/module/types.js.map +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/AsyncStorage.d.ts +10 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/AsyncStorage.native.d.ts +16 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/RCTAsyncStorage.d.ts +2 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/helpers.d.ts +5 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/hooks.d.ts +2 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/index.d.ts +4 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/shouldFallbackToLegacyNativeModule.d.ts +1 -0
- package/node_modules/@react-native-async-storage/async-storage/lib/typescript/types.d.ts +113 -0
- package/node_modules/@react-native-async-storage/async-storage/macos/RNCAsyncStorage.xcodeproj/project.pbxproj +385 -0
- package/node_modules/@react-native-async-storage/async-storage/macos/RNCAsyncStorage.xcodeproj/xcshareddata/xcschemes/RNCAsyncStorage-macOS.xcscheme +67 -0
- package/node_modules/@react-native-async-storage/async-storage/macos/RNCAsyncStorage.xcodeproj/xcshareddata/xcschemes/RNCAsyncStorage.xcscheme +67 -0
- package/node_modules/@react-native-async-storage/async-storage/package.json +197 -0
- package/node_modules/@react-native-async-storage/async-storage/src/AsyncStorage.native.ts +356 -0
- package/node_modules/@react-native-async-storage/async-storage/src/AsyncStorage.ts +173 -0
- package/node_modules/@react-native-async-storage/async-storage/src/RCTAsyncStorage.ts +28 -0
- package/node_modules/@react-native-async-storage/async-storage/src/helpers.ts +74 -0
- package/node_modules/@react-native-async-storage/async-storage/src/hooks.ts +11 -0
- package/node_modules/@react-native-async-storage/async-storage/src/index.ts +7 -0
- package/node_modules/@react-native-async-storage/async-storage/src/shouldFallbackToLegacyNativeModule.ts +34 -0
- package/node_modules/@react-native-async-storage/async-storage/src/types.ts +155 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage/PropertySheet.props +16 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj +172 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj.filters +34 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage/packages.config +4 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage.sln +172 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage61/PropertySheet.props +16 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage61/ReactNativeAsyncStorage61.vcxproj +157 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage61/ReactNativeAsyncStorage61.vcxproj.filters +34 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage61/packages.config +4 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage61.sln +195 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/ReactNativeAsyncStorage62.sln +192 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/DBStorage.cpp +599 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/DBStorage.h +162 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/RNCAsyncStorage.h +118 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/ReactNativeAsyncStorage.def +3 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/ReactPackageProvider.cpp +20 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/ReactPackageProvider.h +23 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/ReactPackageProvider.idl +7 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/pch.cpp +3 -0
- package/node_modules/@react-native-async-storage/async-storage/windows/code/pch.h +15 -0
- package/node_modules/merge-options/index.d.ts +2 -0
- package/node_modules/merge-options/index.js +171 -0
- package/node_modules/merge-options/index.mjs +8 -0
- package/node_modules/merge-options/license +21 -0
- package/node_modules/merge-options/node_modules/is-plain-obj/index.d.ts +29 -0
- package/node_modules/merge-options/node_modules/is-plain-obj/index.js +10 -0
- package/node_modules/merge-options/node_modules/is-plain-obj/license +9 -0
- package/node_modules/merge-options/node_modules/is-plain-obj/package.json +38 -0
- package/node_modules/merge-options/node_modules/is-plain-obj/readme.md +54 -0
- package/node_modules/merge-options/package.json +59 -0
- package/node_modules/merge-options/readme.md +130 -0
- package/package.json +131 -130
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["checkValidArgs","keyValuePairs","callback","Array","isArray","length","Error","checkValidInput","input","key","value","console","warn","convertError","error","out","message","convertErrors","errs","errors","ensureArray","map","e"],"sources":["helpers.ts"],"sourcesContent":["import type { ErrorLike } from './types';\n\nexport function checkValidArgs(keyValuePairs: unknown[], callback: unknown) {\n if (\n !Array.isArray(keyValuePairs) ||\n keyValuePairs.length === 0 ||\n !Array.isArray(keyValuePairs[0])\n ) {\n throw new Error(\n '[AsyncStorage] Expected array of key-value pairs as first argument to multiSet'\n );\n }\n\n if (callback && typeof callback !== 'function') {\n if (Array.isArray(callback)) {\n throw new Error(\n '[AsyncStorage] Expected function as second argument to multiSet. Did you forget to wrap key-value pairs in an array for the first argument?'\n );\n }\n\n throw new Error(\n '[AsyncStorage] Expected function as second argument to multiSet'\n );\n }\n}\n\nexport function checkValidInput(...input: unknown[]) {\n const [key, value] = input;\n\n if (typeof key !== 'string') {\n console.warn(\n `[AsyncStorage] Using ${typeof key} type for key is not supported. This can lead to unexpected behavior/errors. Use string instead.\\nKey passed: ${key}\\n`\n );\n }\n\n if (input.length > 1 && typeof value !== 'string') {\n if (value == null) {\n throw new Error(\n `[AsyncStorage] Passing null/undefined as value is not supported. If you want to remove value, Use .removeItem method instead.\\nPassed value: ${value}\\nPassed key: ${key}\\n`\n );\n } else {\n console.warn(\n `[AsyncStorage] The value for key \"${key}\" is not a string. This can lead to unexpected behavior/errors. Consider stringifying it.\\nPassed value: ${value}\\nPassed key: ${key}\\n`\n );\n }\n }\n}\n\nexport function convertError(error?: ErrorLike): Error | null {\n if (!error) {\n return null;\n }\n\n const out = new Error(error.message);\n (out as any).key = error.key;\n return out;\n}\n\nexport function convertErrors(\n errs?: ErrorLike[]\n): ReadonlyArray<Error | null> | null {\n const errors = ensureArray(errs);\n return errors ? errors.map((e) => convertError(e)) : null;\n}\n\nfunction ensureArray(e?: ErrorLike | ErrorLike[]): ErrorLike[] | null {\n if (Array.isArray(e)) {\n return e.length === 0 ? null : e;\n } else if (e) {\n return [e];\n } else {\n return null;\n }\n}\n"],"mappings":"AAEA,OAAO,SAASA,cAAT,CAAwBC,aAAxB,EAAkDC,QAAlD,EAAqE;EAC1E,IACE,CAACC,KAAK,CAACC,OAAN,CAAcH,aAAd,CAAD,IACAA,aAAa,CAACI,MAAd,KAAyB,CADzB,IAEA,CAACF,KAAK,CAACC,OAAN,CAAcH,aAAa,CAAC,CAAD,CAA3B,CAHH,EAIE;IACA,MAAM,IAAIK,KAAJ,CACJ,gFADI,CAAN;EAGD;;EAED,IAAIJ,QAAQ,IAAI,OAAOA,QAAP,KAAoB,UAApC,EAAgD;IAC9C,IAAIC,KAAK,CAACC,OAAN,CAAcF,QAAd,CAAJ,EAA6B;MAC3B,MAAM,IAAII,KAAJ,CACJ,6IADI,CAAN;IAGD;;IAED,MAAM,IAAIA,KAAJ,CACJ,iEADI,CAAN;EAGD;AACF;AAED,OAAO,SAASC,eAAT,GAA8C;EAAA,kCAAlBC,KAAkB;IAAlBA,KAAkB;EAAA;;EACnD,MAAM,CAACC,GAAD,EAAMC,KAAN,IAAeF,KAArB;;EAEA,IAAI,OAAOC,GAAP,KAAe,QAAnB,EAA6B;IAC3BE,OAAO,CAACC,IAAR,CACG,wBAAuB,OAAOH,GAAI,iHAAgHA,GAAI,IADzJ;EAGD;;EAED,IAAID,KAAK,CAACH,MAAN,GAAe,CAAf,IAAoB,OAAOK,KAAP,KAAiB,QAAzC,EAAmD;IACjD,IAAIA,KAAK,IAAI,IAAb,EAAmB;MACjB,MAAM,IAAIJ,KAAJ,CACH,gJAA+II,KAAM,iBAAgBD,GAAI,IADtK,CAAN;IAGD,CAJD,MAIO;MACLE,OAAO,CAACC,IAAR,CACG,qCAAoCH,GAAI,4GAA2GC,KAAM,iBAAgBD,GAAI,IADhL;IAGD;EACF;AACF;AAED,OAAO,SAASI,YAAT,CAAsBC,KAAtB,EAAuD;EAC5D,IAAI,CAACA,KAAL,EAAY;IACV,OAAO,IAAP;EACD;;EAED,MAAMC,GAAG,GAAG,IAAIT,KAAJ,CAAUQ,KAAK,CAACE,OAAhB,CAAZ;EACCD,GAAD,CAAaN,GAAb,GAAmBK,KAAK,CAACL,GAAzB;EACA,OAAOM,GAAP;AACD;AAED,OAAO,SAASE,aAAT,CACLC,IADK,EAE+B;EACpC,MAAMC,MAAM,GAAGC,WAAW,CAACF,IAAD,CAA1B;EACA,OAAOC,MAAM,GAAGA,MAAM,CAACE,GAAP,CAAYC,CAAD,IAAOT,YAAY,CAACS,CAAD,CAA9B,CAAH,GAAwC,IAArD;AACD;;AAED,SAASF,WAAT,CAAqBE,CAArB,EAAsE;EACpE,IAAInB,KAAK,CAACC,OAAN,CAAckB,CAAd,CAAJ,EAAsB;IACpB,OAAOA,CAAC,CAACjB,MAAF,KAAa,CAAb,GAAiB,IAAjB,GAAwBiB,CAA/B;EACD,CAFD,MAEO,IAAIA,CAAJ,EAAO;IACZ,OAAO,CAACA,CAAD,CAAP;EACD,CAFM,MAEA;IACL,OAAO,IAAP;EACD;AACF"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import AsyncStorage from './AsyncStorage';
|
2
|
+
export function useAsyncStorage(key) {
|
3
|
+
return {
|
4
|
+
getItem: function () {
|
5
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
6
|
+
args[_key] = arguments[_key];
|
7
|
+
}
|
8
|
+
|
9
|
+
return AsyncStorage.getItem(key, ...args);
|
10
|
+
},
|
11
|
+
setItem: function () {
|
12
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
13
|
+
args[_key2] = arguments[_key2];
|
14
|
+
}
|
15
|
+
|
16
|
+
return AsyncStorage.setItem(key, ...args);
|
17
|
+
},
|
18
|
+
mergeItem: function () {
|
19
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
20
|
+
args[_key3] = arguments[_key3];
|
21
|
+
}
|
22
|
+
|
23
|
+
return AsyncStorage.mergeItem(key, ...args);
|
24
|
+
},
|
25
|
+
removeItem: function () {
|
26
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
27
|
+
args[_key4] = arguments[_key4];
|
28
|
+
}
|
29
|
+
|
30
|
+
return AsyncStorage.removeItem(key, ...args);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
}
|
34
|
+
//# sourceMappingURL=hooks.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["AsyncStorage","useAsyncStorage","key","getItem","args","setItem","mergeItem","removeItem"],"sources":["hooks.ts"],"sourcesContent":["import AsyncStorage from './AsyncStorage';\nimport type { AsyncStorageHook } from './types';\n\nexport function useAsyncStorage(key: string): AsyncStorageHook {\n return {\n getItem: (...args) => AsyncStorage.getItem(key, ...args),\n setItem: (...args) => AsyncStorage.setItem(key, ...args),\n mergeItem: (...args) => AsyncStorage.mergeItem(key, ...args),\n removeItem: (...args) => AsyncStorage.removeItem(key, ...args),\n };\n}\n"],"mappings":"AAAA,OAAOA,YAAP,MAAyB,gBAAzB;AAGA,OAAO,SAASC,eAAT,CAAyBC,GAAzB,EAAwD;EAC7D,OAAO;IACLC,OAAO,EAAE;MAAA,kCAAIC,IAAJ;QAAIA,IAAJ;MAAA;;MAAA,OAAaJ,YAAY,CAACG,OAAb,CAAqBD,GAArB,EAA0B,GAAGE,IAA7B,CAAb;IAAA,CADJ;IAELC,OAAO,EAAE;MAAA,mCAAID,IAAJ;QAAIA,IAAJ;MAAA;;MAAA,OAAaJ,YAAY,CAACK,OAAb,CAAqBH,GAArB,EAA0B,GAAGE,IAA7B,CAAb;IAAA,CAFJ;IAGLE,SAAS,EAAE;MAAA,mCAAIF,IAAJ;QAAIA,IAAJ;MAAA;;MAAA,OAAaJ,YAAY,CAACM,SAAb,CAAuBJ,GAAvB,EAA4B,GAAGE,IAA/B,CAAb;IAAA,CAHN;IAILG,UAAU,EAAE;MAAA,mCAAIH,IAAJ;QAAIA,IAAJ;MAAA;;MAAA,OAAaJ,YAAY,CAACO,UAAb,CAAwBL,GAAxB,EAA6B,GAAGE,IAAhC,CAAb;IAAA;EAJP,CAAP;AAMD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["AsyncStorage","useAsyncStorage"],"sources":["index.ts"],"sourcesContent":["import AsyncStorage from './AsyncStorage';\n\nexport { useAsyncStorage } from './hooks';\n\nexport type { AsyncStorageStatic } from './types';\n\nexport default AsyncStorage;\n"],"mappings":"AAAA,OAAOA,YAAP,MAAyB,gBAAzB;AAEA,SAASC,eAAT,QAAgC,SAAhC;AAIA,eAAeD,YAAf"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { NativeModules } from 'react-native';
|
2
|
+
export function shouldFallbackToLegacyNativeModule() {
|
3
|
+
var _NativeModules$Native, _NativeModules$Native2;
|
4
|
+
|
5
|
+
const expoConstants = (_NativeModules$Native = NativeModules['NativeUnimoduleProxy']) === null || _NativeModules$Native === void 0 ? void 0 : (_NativeModules$Native2 = _NativeModules$Native.modulesConstants) === null || _NativeModules$Native2 === void 0 ? void 0 : _NativeModules$Native2.ExponentConstants;
|
6
|
+
|
7
|
+
if (expoConstants) {
|
8
|
+
/**
|
9
|
+
* In SDK <= 39, appOwnership is defined in managed apps but executionEnvironment is not.
|
10
|
+
* In bare React Native apps using expo-constants, appOwnership is never defined, so
|
11
|
+
* isLegacySdkVersion will be false in that context.
|
12
|
+
*/
|
13
|
+
const isLegacySdkVersion = expoConstants.appOwnership && !expoConstants.executionEnvironment;
|
14
|
+
/**
|
15
|
+
* Expo managed apps don't include the @react-native-async-storage/async-storage
|
16
|
+
* native modules yet, but the API interface is the same, so we can use the version
|
17
|
+
* exported from React Native still.
|
18
|
+
*
|
19
|
+
* If in future releases (eg: @react-native-async-storage/async-storage >= 2.0.0) this
|
20
|
+
* will likely not be valid anymore, and the package will need to be included in the Expo SDK
|
21
|
+
* to continue to work.
|
22
|
+
*/
|
23
|
+
|
24
|
+
if (isLegacySdkVersion || ['storeClient', 'standalone'].includes(expoConstants.executionEnvironment)) {
|
25
|
+
return true;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
//# sourceMappingURL=shouldFallbackToLegacyNativeModule.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NativeModules","shouldFallbackToLegacyNativeModule","expoConstants","modulesConstants","ExponentConstants","isLegacySdkVersion","appOwnership","executionEnvironment","includes"],"sources":["shouldFallbackToLegacyNativeModule.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\n\nexport function shouldFallbackToLegacyNativeModule(): boolean {\n const expoConstants =\n NativeModules['NativeUnimoduleProxy']?.modulesConstants?.ExponentConstants;\n\n if (expoConstants) {\n /**\n * In SDK <= 39, appOwnership is defined in managed apps but executionEnvironment is not.\n * In bare React Native apps using expo-constants, appOwnership is never defined, so\n * isLegacySdkVersion will be false in that context.\n */\n const isLegacySdkVersion =\n expoConstants.appOwnership && !expoConstants.executionEnvironment;\n\n /**\n * Expo managed apps don't include the @react-native-async-storage/async-storage\n * native modules yet, but the API interface is the same, so we can use the version\n * exported from React Native still.\n *\n * If in future releases (eg: @react-native-async-storage/async-storage >= 2.0.0) this\n * will likely not be valid anymore, and the package will need to be included in the Expo SDK\n * to continue to work.\n */\n if (\n isLegacySdkVersion ||\n ['storeClient', 'standalone'].includes(expoConstants.executionEnvironment)\n ) {\n return true;\n }\n }\n\n return false;\n}\n"],"mappings":"AAAA,SAASA,aAAT,QAA8B,cAA9B;AAEA,OAAO,SAASC,kCAAT,GAAuD;EAAA;;EAC5D,MAAMC,aAAa,4BACjBF,aAAa,CAAC,sBAAD,CADI,oFACjB,sBAAuCG,gBADtB,2DACjB,uBAAyDC,iBAD3D;;EAGA,IAAIF,aAAJ,EAAmB;IACjB;AACJ;AACA;AACA;AACA;IACI,MAAMG,kBAAkB,GACtBH,aAAa,CAACI,YAAd,IAA8B,CAACJ,aAAa,CAACK,oBAD/C;IAGA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACI,IACEF,kBAAkB,IAClB,CAAC,aAAD,EAAgB,YAAhB,EAA8BG,QAA9B,CAAuCN,aAAa,CAACK,oBAArD,CAFF,EAGE;MACA,OAAO,IAAP;IACD;EACF;;EAED,OAAO,KAAP;AACD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type ErrorLike = {\n message: string;\n key: string;\n};\n\nexport type Callback = (error?: Error | null) => void;\n\nexport type CallbackWithResult<T> = (\n error?: Error | null,\n result?: T | null\n) => void;\n\nexport type KeyValuePair = [string, string | null];\n\nexport type MultiCallback = (errors?: readonly (Error | null)[] | null) => void;\n\nexport type MultiGetCallback = (\n errors?: readonly (Error | null)[] | null,\n result?: readonly KeyValuePair[]\n) => void;\n\nexport type MultiRequest = {\n keys: readonly string[];\n callback?: MultiGetCallback;\n keyIndex: number;\n resolve?: (result: readonly KeyValuePair[]) => void;\n reject?: (error?: any) => void;\n};\n\nexport type AsyncStorageHook = {\n getItem: (callback?: CallbackWithResult<string>) => Promise<string | null>;\n setItem: (value: string, callback?: Callback) => Promise<void>;\n mergeItem: (value: string, callback?: Callback) => Promise<void>;\n removeItem: (callback?: Callback) => Promise<void>;\n};\n\n/**\n * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value\n * storage system that is global to the app. It should be used instead of\n * LocalStorage.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api\n */\nexport type AsyncStorageStatic = {\n /**\n * Fetches an item for a `key` and invokes a callback upon completion.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#getitem\n */\n getItem: (\n key: string,\n callback?: CallbackWithResult<string>\n ) => Promise<string | null>;\n\n /**\n * Sets the value for a `key` and invokes a callback upon completion.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#setitem\n */\n setItem: (key: string, value: string, callback?: Callback) => Promise<void>;\n\n /**\n * Removes an item for a `key` and invokes a callback upon completion.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#removeitem\n */\n removeItem: (key: string, callback?: Callback) => Promise<void>;\n\n /**\n * Merges an existing `key` value with an input value, assuming both values\n * are stringified JSON.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#mergeitem\n */\n mergeItem: (key: string, value: string, callback?: Callback) => Promise<void>;\n\n /**\n * Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably\n * don't want to call this; use `removeItem` or `multiRemove` to clear only\n * your app's keys.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#clear\n */\n clear: (callback?: Callback) => Promise<void>;\n\n /**\n * Gets *all* keys known to your app; for all callers, libraries, etc.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#getallkeys\n */\n getAllKeys: (\n callback?: CallbackWithResult<readonly string[]>\n ) => Promise<readonly string[]>;\n\n /**\n * The following batched functions are useful for executing a lot of\n * operations at once, allowing for native optimizations and provide the\n * convenience of a single callback after all operations are complete.\n *\n * These functions return arrays of errors, potentially one for every key.\n * For key-specific errors, the Error object will have a key property to\n * indicate which key caused the error.\n */\n\n /**\n * Flushes any pending requests using a single batch call to get the data.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#flushgetrequests\n * */\n flushGetRequests: () => void;\n\n /**\n * This allows you to batch the fetching of items given an array of `key`\n * inputs. Your callback will be invoked with an array of corresponding\n * key-value pairs found.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#multiget\n */\n multiGet: (\n keys: readonly string[],\n callback?: MultiGetCallback\n ) => Promise<readonly KeyValuePair[]>;\n\n /**\n * Use this as a batch operation for storing multiple key-value pairs. When\n * the operation completes you'll get a single callback with any errors.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#multiset\n */\n multiSet: (\n keyValuePairs: [string, string][],\n callback?: MultiCallback\n ) => Promise<void>;\n\n /**\n * Call this to batch the deletion of all keys in the `keys` array.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#multiremove\n */\n multiRemove: (\n keys: readonly string[],\n callback?: MultiCallback\n ) => Promise<void>;\n\n /**\n * Batch operation to merge in existing and new values for a given set of\n * keys. This assumes that the values are stringified JSON.\n *\n * See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge\n */\n multiMerge: (\n keyValuePairs: [string, string][],\n callback?: MultiCallback\n ) => Promise<void>;\n};\n"],"mappings":""}
|
package/node_modules/@react-native-async-storage/async-storage/lib/typescript/AsyncStorage.d.ts
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) Nicolas Gallagher.
|
3
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
4
|
+
*
|
5
|
+
* This source code is licensed under the MIT license found in the
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
7
|
+
*/
|
8
|
+
import type { AsyncStorageStatic } from './types';
|
9
|
+
declare const AsyncStorage: AsyncStorageStatic;
|
10
|
+
export default AsyncStorage;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import type { AsyncStorageStatic } from './types';
|
8
|
+
/**
|
9
|
+
* `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value
|
10
|
+
* storage system that is global to the app. It should be used instead of
|
11
|
+
* LocalStorage.
|
12
|
+
*
|
13
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api
|
14
|
+
*/
|
15
|
+
declare const AsyncStorage: AsyncStorageStatic;
|
16
|
+
export default AsyncStorage;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { ErrorLike } from './types';
|
2
|
+
export declare function checkValidArgs(keyValuePairs: unknown[], callback: unknown): void;
|
3
|
+
export declare function checkValidInput(...input: unknown[]): void;
|
4
|
+
export declare function convertError(error?: ErrorLike): Error | null;
|
5
|
+
export declare function convertErrors(errs?: ErrorLike[]): ReadonlyArray<Error | null> | null;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function shouldFallbackToLegacyNativeModule(): boolean;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
export declare type ErrorLike = {
|
2
|
+
message: string;
|
3
|
+
key: string;
|
4
|
+
};
|
5
|
+
export declare type Callback = (error?: Error | null) => void;
|
6
|
+
export declare type CallbackWithResult<T> = (error?: Error | null, result?: T | null) => void;
|
7
|
+
export declare type KeyValuePair = [string, string | null];
|
8
|
+
export declare type MultiCallback = (errors?: readonly (Error | null)[] | null) => void;
|
9
|
+
export declare type MultiGetCallback = (errors?: readonly (Error | null)[] | null, result?: readonly KeyValuePair[]) => void;
|
10
|
+
export declare type MultiRequest = {
|
11
|
+
keys: readonly string[];
|
12
|
+
callback?: MultiGetCallback;
|
13
|
+
keyIndex: number;
|
14
|
+
resolve?: (result: readonly KeyValuePair[]) => void;
|
15
|
+
reject?: (error?: any) => void;
|
16
|
+
};
|
17
|
+
export declare type AsyncStorageHook = {
|
18
|
+
getItem: (callback?: CallbackWithResult<string>) => Promise<string | null>;
|
19
|
+
setItem: (value: string, callback?: Callback) => Promise<void>;
|
20
|
+
mergeItem: (value: string, callback?: Callback) => Promise<void>;
|
21
|
+
removeItem: (callback?: Callback) => Promise<void>;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value
|
25
|
+
* storage system that is global to the app. It should be used instead of
|
26
|
+
* LocalStorage.
|
27
|
+
*
|
28
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api
|
29
|
+
*/
|
30
|
+
export declare type AsyncStorageStatic = {
|
31
|
+
/**
|
32
|
+
* Fetches an item for a `key` and invokes a callback upon completion.
|
33
|
+
*
|
34
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#getitem
|
35
|
+
*/
|
36
|
+
getItem: (key: string, callback?: CallbackWithResult<string>) => Promise<string | null>;
|
37
|
+
/**
|
38
|
+
* Sets the value for a `key` and invokes a callback upon completion.
|
39
|
+
*
|
40
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#setitem
|
41
|
+
*/
|
42
|
+
setItem: (key: string, value: string, callback?: Callback) => Promise<void>;
|
43
|
+
/**
|
44
|
+
* Removes an item for a `key` and invokes a callback upon completion.
|
45
|
+
*
|
46
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#removeitem
|
47
|
+
*/
|
48
|
+
removeItem: (key: string, callback?: Callback) => Promise<void>;
|
49
|
+
/**
|
50
|
+
* Merges an existing `key` value with an input value, assuming both values
|
51
|
+
* are stringified JSON.
|
52
|
+
*
|
53
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#mergeitem
|
54
|
+
*/
|
55
|
+
mergeItem: (key: string, value: string, callback?: Callback) => Promise<void>;
|
56
|
+
/**
|
57
|
+
* Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably
|
58
|
+
* don't want to call this; use `removeItem` or `multiRemove` to clear only
|
59
|
+
* your app's keys.
|
60
|
+
*
|
61
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#clear
|
62
|
+
*/
|
63
|
+
clear: (callback?: Callback) => Promise<void>;
|
64
|
+
/**
|
65
|
+
* Gets *all* keys known to your app; for all callers, libraries, etc.
|
66
|
+
*
|
67
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#getallkeys
|
68
|
+
*/
|
69
|
+
getAllKeys: (callback?: CallbackWithResult<readonly string[]>) => Promise<readonly string[]>;
|
70
|
+
/**
|
71
|
+
* The following batched functions are useful for executing a lot of
|
72
|
+
* operations at once, allowing for native optimizations and provide the
|
73
|
+
* convenience of a single callback after all operations are complete.
|
74
|
+
*
|
75
|
+
* These functions return arrays of errors, potentially one for every key.
|
76
|
+
* For key-specific errors, the Error object will have a key property to
|
77
|
+
* indicate which key caused the error.
|
78
|
+
*/
|
79
|
+
/**
|
80
|
+
* Flushes any pending requests using a single batch call to get the data.
|
81
|
+
*
|
82
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#flushgetrequests
|
83
|
+
* */
|
84
|
+
flushGetRequests: () => void;
|
85
|
+
/**
|
86
|
+
* This allows you to batch the fetching of items given an array of `key`
|
87
|
+
* inputs. Your callback will be invoked with an array of corresponding
|
88
|
+
* key-value pairs found.
|
89
|
+
*
|
90
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#multiget
|
91
|
+
*/
|
92
|
+
multiGet: (keys: readonly string[], callback?: MultiGetCallback) => Promise<readonly KeyValuePair[]>;
|
93
|
+
/**
|
94
|
+
* Use this as a batch operation for storing multiple key-value pairs. When
|
95
|
+
* the operation completes you'll get a single callback with any errors.
|
96
|
+
*
|
97
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#multiset
|
98
|
+
*/
|
99
|
+
multiSet: (keyValuePairs: [string, string][], callback?: MultiCallback) => Promise<void>;
|
100
|
+
/**
|
101
|
+
* Call this to batch the deletion of all keys in the `keys` array.
|
102
|
+
*
|
103
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#multiremove
|
104
|
+
*/
|
105
|
+
multiRemove: (keys: readonly string[], callback?: MultiCallback) => Promise<void>;
|
106
|
+
/**
|
107
|
+
* Batch operation to merge in existing and new values for a given set of
|
108
|
+
* keys. This assumes that the values are stringified JSON.
|
109
|
+
*
|
110
|
+
* See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge
|
111
|
+
*/
|
112
|
+
multiMerge: (keyValuePairs: [string, string][], callback?: MultiCallback) => Promise<void>;
|
113
|
+
};
|