@webority/mobile-core 0.149.0 → 0.150.0

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.
Files changed (238) hide show
  1. package/lib/commonjs/api/baseUrl.js +1 -1
  2. package/lib/commonjs/api/contractCaller.js +1 -0
  3. package/lib/commonjs/api/curl.js +1 -1
  4. package/lib/commonjs/api/minAppVersion.js +1 -1
  5. package/lib/commonjs/api/requestDefaults.js +1 -1
  6. package/lib/commonjs/api/retry.js +1 -1
  7. package/lib/commonjs/api/tokenRefresh.js +1 -1
  8. package/lib/commonjs/api/userClient.js +1 -1
  9. package/lib/commonjs/api/workspace.js +1 -1
  10. package/lib/commonjs/auth/authStore.js +1 -1
  11. package/lib/commonjs/auth/jwt.js +1 -1
  12. package/lib/commonjs/deepLink/index.js +1 -1
  13. package/lib/commonjs/download/adapters/expoFs.js +1 -1
  14. package/lib/commonjs/download/index.js +1 -1
  15. package/lib/commonjs/errors/extractApiError.js +1 -1
  16. package/lib/commonjs/errors/index.js +1 -1
  17. package/lib/commonjs/errors/parseResponse.js +1 -0
  18. package/lib/commonjs/errors/requestPlatform.js +1 -0
  19. package/lib/commonjs/formatters/currency.js +1 -1
  20. package/lib/commonjs/formatters/date.js +1 -1
  21. package/lib/commonjs/formatters/dateMath.js +1 -1
  22. package/lib/commonjs/formatters/formatConfig.js +1 -1
  23. package/lib/commonjs/formatters/house.js +1 -1
  24. package/lib/commonjs/formatters/number.js +1 -1
  25. package/lib/commonjs/formatters/phone.js +1 -1
  26. package/lib/commonjs/geolocation/index.js +1 -1
  27. package/lib/commonjs/index.js +1 -1
  28. package/lib/commonjs/india/gstStates.js +1 -0
  29. package/lib/commonjs/india/index.js +1 -1
  30. package/lib/commonjs/logger/crashlytics.js +1 -1
  31. package/lib/commonjs/logger/index.js +1 -1
  32. package/lib/commonjs/logger/redact.js +1 -1
  33. package/lib/commonjs/network/networkStatus.js +1 -1
  34. package/lib/commonjs/outbox/outbox.js +1 -1
  35. package/lib/commonjs/push/broadcasts.js +1 -1
  36. package/lib/commonjs/push/push.js +1 -1
  37. package/lib/commonjs/query/apiBaseQuery.js +1 -1
  38. package/lib/commonjs/query/dataState.js +1 -0
  39. package/lib/commonjs/query/index.js +1 -1
  40. package/lib/commonjs/query/persistedQueries.js +1 -1
  41. package/lib/commonjs/query/tags.js +1 -1
  42. package/lib/commonjs/query/usePagedList.js +1 -1
  43. package/lib/commonjs/redux/errorToastMiddleware.js +1 -1
  44. package/lib/commonjs/redux/rootReducer.js +1 -1
  45. package/lib/commonjs/redux/sessionMiddleware.js +1 -1
  46. package/lib/commonjs/review/index.js +1 -1
  47. package/lib/commonjs/secureScreen/index.js +1 -1
  48. package/lib/commonjs/sqlite/index.js +1 -1
  49. package/lib/commonjs/storage/index.js +1 -1
  50. package/lib/commonjs/types/complete.js +1 -0
  51. package/lib/commonjs/types/formData.d.js +1 -0
  52. package/lib/commonjs/updates/updates.js +1 -1
  53. package/lib/commonjs/utils/base64.js +1 -1
  54. package/lib/commonjs/utils/guards.js +1 -0
  55. package/lib/commonjs/utils/imageCompression.js +1 -1
  56. package/lib/module/api/baseUrl.js +1 -1
  57. package/lib/module/api/contractCaller.js +1 -0
  58. package/lib/module/api/curl.js +1 -1
  59. package/lib/module/api/minAppVersion.js +1 -1
  60. package/lib/module/api/requestDefaults.js +1 -1
  61. package/lib/module/api/retry.js +1 -1
  62. package/lib/module/api/tokenRefresh.js +1 -1
  63. package/lib/module/api/userClient.js +1 -1
  64. package/lib/module/api/workspace.js +1 -1
  65. package/lib/module/auth/authStore.js +1 -1
  66. package/lib/module/auth/jwt.js +1 -1
  67. package/lib/module/deepLink/index.js +1 -1
  68. package/lib/module/download/adapters/expoFs.js +1 -1
  69. package/lib/module/download/index.js +1 -1
  70. package/lib/module/errors/extractApiError.js +1 -1
  71. package/lib/module/errors/index.js +1 -1
  72. package/lib/module/errors/parseResponse.js +1 -0
  73. package/lib/module/errors/requestPlatform.js +1 -0
  74. package/lib/module/formatters/currency.js +1 -1
  75. package/lib/module/formatters/date.js +1 -1
  76. package/lib/module/formatters/dateMath.js +1 -1
  77. package/lib/module/formatters/formatConfig.js +1 -1
  78. package/lib/module/formatters/house.js +1 -1
  79. package/lib/module/formatters/number.js +1 -1
  80. package/lib/module/formatters/phone.js +1 -1
  81. package/lib/module/geolocation/index.js +1 -1
  82. package/lib/module/index.js +1 -1
  83. package/lib/module/india/gstStates.js +1 -0
  84. package/lib/module/india/index.js +1 -1
  85. package/lib/module/logger/crashlytics.js +1 -1
  86. package/lib/module/logger/index.js +1 -1
  87. package/lib/module/logger/redact.js +1 -1
  88. package/lib/module/network/networkStatus.js +1 -1
  89. package/lib/module/outbox/outbox.js +1 -1
  90. package/lib/module/push/broadcasts.js +1 -1
  91. package/lib/module/push/push.js +1 -1
  92. package/lib/module/query/apiBaseQuery.js +1 -1
  93. package/lib/module/query/dataState.js +1 -0
  94. package/lib/module/query/index.js +1 -1
  95. package/lib/module/query/persistedQueries.js +1 -1
  96. package/lib/module/query/tags.js +1 -1
  97. package/lib/module/query/usePagedList.js +1 -1
  98. package/lib/module/redux/errorToastMiddleware.js +1 -1
  99. package/lib/module/redux/rootReducer.js +1 -1
  100. package/lib/module/redux/sessionMiddleware.js +1 -1
  101. package/lib/module/review/index.js +1 -1
  102. package/lib/module/secureScreen/index.js +1 -1
  103. package/lib/module/sqlite/index.js +1 -1
  104. package/lib/module/storage/index.js +1 -1
  105. package/lib/module/types/complete.js +1 -0
  106. package/lib/module/types/formData.d.js +1 -0
  107. package/lib/module/updates/updates.js +1 -1
  108. package/lib/module/utils/base64.js +1 -1
  109. package/lib/module/utils/guards.js +1 -0
  110. package/lib/module/utils/imageCompression.js +1 -1
  111. package/lib/typescript/commonjs/api/clientHeaders.d.ts +1 -1
  112. package/lib/typescript/commonjs/api/contractCaller.d.ts +7 -0
  113. package/lib/typescript/commonjs/api/fetchRetry.d.ts +3 -3
  114. package/lib/typescript/commonjs/api/minAppVersion.d.ts +1 -1
  115. package/lib/typescript/commonjs/api/retry.d.ts +11 -5
  116. package/lib/typescript/commonjs/api/tokenRefresh.d.ts +2 -1
  117. package/lib/typescript/commonjs/api/userClient.d.ts +11 -0
  118. package/lib/typescript/commonjs/api/workspace.d.ts +3 -3
  119. package/lib/typescript/commonjs/appLock/index.d.ts +1 -1
  120. package/lib/typescript/commonjs/attachments/index.d.ts +5 -5
  121. package/lib/typescript/commonjs/auth/authStore.d.ts +8 -6
  122. package/lib/typescript/commonjs/auth/jwt.d.ts +11 -8
  123. package/lib/typescript/commonjs/deepLink/index.d.ts +18 -11
  124. package/lib/typescript/commonjs/download/adapters/expoFs.d.ts +4 -4
  125. package/lib/typescript/commonjs/download/index.d.ts +16 -12
  126. package/lib/typescript/commonjs/errors/extractApiError.d.ts +5 -17
  127. package/lib/typescript/commonjs/errors/index.d.ts +2 -0
  128. package/lib/typescript/commonjs/errors/parseResponse.d.ts +20 -0
  129. package/lib/typescript/commonjs/errors/requestPlatform.d.ts +8 -0
  130. package/lib/typescript/commonjs/formatters/currency.d.ts +5 -5
  131. package/lib/typescript/commonjs/formatters/dateMath.d.ts +2 -2
  132. package/lib/typescript/commonjs/formatters/formatConfig.d.ts +8 -6
  133. package/lib/typescript/commonjs/formatters/house.d.ts +19 -20
  134. package/lib/typescript/commonjs/formatters/intlCache.d.ts +1 -3
  135. package/lib/typescript/commonjs/formatters/phone.d.ts +3 -3
  136. package/lib/typescript/commonjs/geolocation/adapters/expoLocation.d.ts +11 -11
  137. package/lib/typescript/commonjs/geolocation/index.d.ts +29 -26
  138. package/lib/typescript/commonjs/index.d.ts +5 -2
  139. package/lib/typescript/commonjs/india/gstStates.d.ts +8 -0
  140. package/lib/typescript/commonjs/india/gstStates.g.d.ts +1 -1
  141. package/lib/typescript/commonjs/india/index.d.ts +1 -0
  142. package/lib/typescript/commonjs/initSDK.d.ts +14 -14
  143. package/lib/typescript/commonjs/initUserAuth.d.ts +9 -8
  144. package/lib/typescript/commonjs/logger/crashlytics.d.ts +5 -4
  145. package/lib/typescript/commonjs/logger/index.d.ts +19 -19
  146. package/lib/typescript/commonjs/logger/redact.d.ts +3 -1
  147. package/lib/typescript/commonjs/metro/types.d.ts +4 -4
  148. package/lib/typescript/commonjs/network/networkStatus.d.ts +1 -1
  149. package/lib/typescript/commonjs/outbox/types.d.ts +6 -6
  150. package/lib/typescript/commonjs/permissions/index.d.ts +7 -4
  151. package/lib/typescript/commonjs/pickers/index.d.ts +18 -18
  152. package/lib/typescript/commonjs/push/push.d.ts +23 -23
  153. package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +14 -14
  154. package/lib/typescript/commonjs/query/dataState.d.ts +58 -0
  155. package/lib/typescript/commonjs/query/index.d.ts +3 -1
  156. package/lib/typescript/commonjs/query/paging.d.ts +5 -5
  157. package/lib/typescript/commonjs/query/persistedQueries.d.ts +12 -7
  158. package/lib/typescript/commonjs/query/usePagedList.d.ts +9 -17
  159. package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +4 -4
  160. package/lib/typescript/commonjs/redux/rootReducer.d.ts +1 -1
  161. package/lib/typescript/commonjs/review/index.d.ts +1 -1
  162. package/lib/typescript/commonjs/secureScreen/index.d.ts +1 -1
  163. package/lib/typescript/commonjs/share/index.d.ts +2 -2
  164. package/lib/typescript/commonjs/sqlite/index.d.ts +21 -16
  165. package/lib/typescript/commonjs/storage/index.d.ts +9 -9
  166. package/lib/typescript/commonjs/types/axios.d.ts +2 -2
  167. package/lib/typescript/commonjs/types/complete.d.ts +5 -0
  168. package/lib/typescript/commonjs/updates/updates.d.ts +20 -20
  169. package/lib/typescript/commonjs/utils/guards.d.ts +9 -0
  170. package/lib/typescript/commonjs/utils/imageCompression.d.ts +9 -9
  171. package/lib/typescript/commonjs/validators/index.d.ts +5 -5
  172. package/lib/typescript/commonjs/versionCheck/appBuild.d.ts +3 -2
  173. package/lib/typescript/commonjs/versionCheck/index.d.ts +4 -4
  174. package/lib/typescript/module/api/clientHeaders.d.ts +1 -1
  175. package/lib/typescript/module/api/contractCaller.d.ts +7 -0
  176. package/lib/typescript/module/api/fetchRetry.d.ts +3 -3
  177. package/lib/typescript/module/api/minAppVersion.d.ts +1 -1
  178. package/lib/typescript/module/api/retry.d.ts +11 -5
  179. package/lib/typescript/module/api/tokenRefresh.d.ts +2 -1
  180. package/lib/typescript/module/api/userClient.d.ts +11 -0
  181. package/lib/typescript/module/api/workspace.d.ts +3 -3
  182. package/lib/typescript/module/appLock/index.d.ts +1 -1
  183. package/lib/typescript/module/attachments/index.d.ts +5 -5
  184. package/lib/typescript/module/auth/authStore.d.ts +8 -6
  185. package/lib/typescript/module/auth/jwt.d.ts +11 -8
  186. package/lib/typescript/module/deepLink/index.d.ts +18 -11
  187. package/lib/typescript/module/download/adapters/expoFs.d.ts +4 -4
  188. package/lib/typescript/module/download/index.d.ts +16 -12
  189. package/lib/typescript/module/errors/extractApiError.d.ts +5 -17
  190. package/lib/typescript/module/errors/index.d.ts +2 -0
  191. package/lib/typescript/module/errors/parseResponse.d.ts +20 -0
  192. package/lib/typescript/module/errors/requestPlatform.d.ts +8 -0
  193. package/lib/typescript/module/formatters/currency.d.ts +5 -5
  194. package/lib/typescript/module/formatters/dateMath.d.ts +2 -2
  195. package/lib/typescript/module/formatters/formatConfig.d.ts +8 -6
  196. package/lib/typescript/module/formatters/house.d.ts +19 -20
  197. package/lib/typescript/module/formatters/intlCache.d.ts +1 -3
  198. package/lib/typescript/module/formatters/phone.d.ts +3 -3
  199. package/lib/typescript/module/geolocation/adapters/expoLocation.d.ts +11 -11
  200. package/lib/typescript/module/geolocation/index.d.ts +29 -26
  201. package/lib/typescript/module/index.d.ts +5 -2
  202. package/lib/typescript/module/india/gstStates.d.ts +8 -0
  203. package/lib/typescript/module/india/gstStates.g.d.ts +1 -1
  204. package/lib/typescript/module/india/index.d.ts +1 -0
  205. package/lib/typescript/module/initSDK.d.ts +14 -14
  206. package/lib/typescript/module/initUserAuth.d.ts +9 -8
  207. package/lib/typescript/module/logger/crashlytics.d.ts +5 -4
  208. package/lib/typescript/module/logger/index.d.ts +19 -19
  209. package/lib/typescript/module/logger/redact.d.ts +3 -1
  210. package/lib/typescript/module/metro/types.d.ts +4 -4
  211. package/lib/typescript/module/network/networkStatus.d.ts +1 -1
  212. package/lib/typescript/module/outbox/types.d.ts +6 -6
  213. package/lib/typescript/module/permissions/index.d.ts +7 -4
  214. package/lib/typescript/module/pickers/index.d.ts +18 -18
  215. package/lib/typescript/module/push/push.d.ts +23 -23
  216. package/lib/typescript/module/query/apiBaseQuery.d.ts +14 -14
  217. package/lib/typescript/module/query/dataState.d.ts +58 -0
  218. package/lib/typescript/module/query/index.d.ts +3 -1
  219. package/lib/typescript/module/query/paging.d.ts +5 -5
  220. package/lib/typescript/module/query/persistedQueries.d.ts +12 -7
  221. package/lib/typescript/module/query/usePagedList.d.ts +9 -17
  222. package/lib/typescript/module/redux/errorToastMiddleware.d.ts +4 -4
  223. package/lib/typescript/module/redux/rootReducer.d.ts +1 -1
  224. package/lib/typescript/module/review/index.d.ts +1 -1
  225. package/lib/typescript/module/secureScreen/index.d.ts +1 -1
  226. package/lib/typescript/module/share/index.d.ts +2 -2
  227. package/lib/typescript/module/sqlite/index.d.ts +21 -16
  228. package/lib/typescript/module/storage/index.d.ts +9 -9
  229. package/lib/typescript/module/types/axios.d.ts +2 -2
  230. package/lib/typescript/module/types/complete.d.ts +5 -0
  231. package/lib/typescript/module/updates/updates.d.ts +20 -20
  232. package/lib/typescript/module/utils/guards.d.ts +9 -0
  233. package/lib/typescript/module/utils/imageCompression.d.ts +9 -9
  234. package/lib/typescript/module/validators/index.d.ts +5 -5
  235. package/lib/typescript/module/versionCheck/appBuild.d.ts +3 -2
  236. package/lib/typescript/module/versionCheck/index.d.ts +4 -4
  237. package/package.json +3 -2
  238. package/src/specs/NativeSmsRetriever.ts +1 -1
@@ -11,7 +11,7 @@ interface ExpoPermissionResponse {
11
11
  granted: boolean;
12
12
  canAskAgain: boolean;
13
13
  /** iOS partial photo access, from expo-image-picker's MediaLibraryPermissionResponse. */
14
- accessPrivileges?: "all" | "limited" | "none";
14
+ accessPrivileges?: "all" | "limited" | "none" | undefined;
15
15
  }
16
16
  interface ExpoPermissionFns {
17
17
  check: () => Promise<ExpoPermissionResponse>;
@@ -32,6 +32,9 @@ export interface PermissionsBackend {
32
32
  export declare const setPermissionsImplementation: (impl: PermissionsBackend | null) => void;
33
33
  /** Called by the per-package entry points to register their kind(s). Not for app code. */
34
34
  export declare const registerPermissionAdapter: (kind: PermissionKind, fns: ExpoPermissionFns) => void;
35
+ declare const checkPermission: (kind: PermissionKind) => Promise<PermissionStatus>;
36
+ declare const requestPermission: (kind: PermissionKind) => Promise<PermissionStatus>;
37
+ declare const openAppSettings: () => Promise<boolean>;
35
38
  /**
36
39
  * Cross-platform permissions wrapper. Maps an abstract `PermissionKind`
37
40
  * (camera, photos, location, notifications, …) to whichever Expo adapter an
@@ -41,13 +44,13 @@ export declare const registerPermissionAdapter: (kind: PermissionKind, fns: Expo
41
44
  * points for the kinds it actually asks for.
42
45
  */
43
46
  export declare const Permissions: {
44
- check: (kind: PermissionKind) => Promise<PermissionStatus>;
45
- request: (kind: PermissionKind) => Promise<PermissionStatus>;
47
+ check: typeof checkPermission;
48
+ request: typeof requestPermission;
46
49
  /** Convenience: returns true when the permission is `granted` or `limited`. */
47
50
  isAuthorized: (kind: PermissionKind) => Promise<boolean>;
48
51
  /** Convenience: check, and request only when the status is `undetermined` or `denied`. */
49
52
  ensure: (kind: PermissionKind) => Promise<PermissionStatus>;
50
- openSettings: () => Promise<boolean>;
53
+ openSettings: typeof openAppSettings;
51
54
  };
52
55
  export {};
53
56
  //# sourceMappingURL=index.d.ts.map
@@ -1,34 +1,34 @@
1
1
  export interface PickedFile {
2
2
  uri: string;
3
- name?: string;
4
- type?: string;
5
- size?: number;
6
- meta?: Record<string, unknown>;
3
+ name?: string | undefined;
4
+ type?: string | undefined;
5
+ size?: number | undefined;
6
+ meta?: Record<string, unknown> | undefined;
7
7
  }
8
8
  export interface PickerSource {
9
9
  key: string;
10
10
  label: string;
11
- description?: string;
11
+ description?: string | undefined;
12
12
  pick: () => Promise<PickedFile[]>;
13
13
  }
14
14
  export interface PhotoOptions {
15
- maxEdgePx?: number;
16
- quality?: number;
17
- multiple?: boolean;
18
- limit?: number;
15
+ maxEdgePx?: number | undefined;
16
+ quality?: number | undefined;
17
+ multiple?: boolean | undefined;
18
+ limit?: number | undefined;
19
19
  /** What the library offers; photos only by default. */
20
- mediaTypes?: ReadonlyArray<"images" | "videos">;
20
+ mediaTypes?: ReadonlyArray<"images" | "videos"> | undefined;
21
21
  }
22
22
  export declare function whenSheetHasClosed(): Promise<void>;
23
23
  /** Bounds the longer side to `maxEdgePx`, re-encodes as JPEG at `quality` and returns the file named `photo-<time>.jpg`. */
24
24
  export declare function boundPhoto(asset: {
25
25
  uri: string;
26
- width?: number;
27
- height?: number;
28
- type?: "image" | "video" | "livePhoto" | "pairedVideo" | null;
29
- fileName?: string | null;
30
- mimeType?: string;
31
- fileSize?: number;
26
+ width?: number | undefined;
27
+ height?: number | undefined;
28
+ type?: "image" | "video" | "livePhoto" | "pairedVideo" | null | undefined;
29
+ fileName?: string | null | undefined;
30
+ mimeType?: string | undefined;
31
+ fileSize?: number | undefined;
32
32
  }, options?: PhotoOptions): Promise<PickedFile>;
33
33
  export declare function cameraSource(options: PhotoOptions & {
34
34
  label: string;
@@ -38,7 +38,7 @@ export declare function photoLibrarySource(options: PhotoOptions & {
38
38
  }): PickerSource;
39
39
  export declare function documentSource(options: {
40
40
  label: string;
41
- types?: string[];
42
- multiple?: boolean;
41
+ types?: string[] | undefined;
42
+ multiple?: boolean | undefined;
43
43
  }): PickerSource;
44
44
  //# sourceMappingURL=index.d.ts.map
@@ -33,12 +33,12 @@ export interface EnablePushOptions {
33
33
  * registered silently and any other phone is left alone, so the app can ask
34
34
  * later at a moment it chooses.
35
35
  */
36
- prompt?: boolean;
36
+ prompt?: boolean | undefined;
37
37
  }
38
38
  export interface PushAndroidChannel {
39
39
  id: string;
40
40
  name: string;
41
- importance?: "default" | "high";
41
+ importance?: "default" | "high" | undefined;
42
42
  }
43
43
  export interface PushConfig {
44
44
  getInstallationId: () => Promise<string> | string;
@@ -49,27 +49,27 @@ export interface PushConfig {
49
49
  /** A notification was tapped, including the tap that launched the app. */
50
50
  onOpen: (data: Record<string, string>) => void;
51
51
  /** Only for channels the app does not create natively. */
52
- androidChannels?: PushAndroidChannel[];
52
+ androidChannels?: PushAndroidChannel[] | undefined;
53
53
  /** Whether a notification arriving while the app is open is shown. Defaults to true. */
54
- showInForeground?: () => boolean;
54
+ showInForeground?: (() => boolean) | undefined;
55
55
  /** Whether a notification shown while the app is open plays its sound. Defaults to true. */
56
- playSoundInForeground?: () => boolean;
56
+ playSoundInForeground?: (() => boolean) | undefined;
57
57
  }
58
58
  /** A button on a notification category. */
59
59
  export interface PushCategoryAction {
60
60
  id: string;
61
61
  title: string;
62
62
  /** Whether the tap brings the app to the foreground. Defaults to true. */
63
- opensApp?: boolean;
63
+ opensApp?: boolean | undefined;
64
64
  /** iOS only: the title shows in red. */
65
- destructive?: boolean;
65
+ destructive?: boolean | undefined;
66
66
  /** Turns the button into a reply box; the text arrives as `userText`. */
67
67
  textInput?: {
68
68
  submitTitle: string;
69
69
  placeholder: string;
70
- };
70
+ } | undefined;
71
71
  /** iOS only: the phone must be unlocked before the action runs. */
72
- authenticationRequired?: boolean;
72
+ authenticationRequired?: boolean | undefined;
73
73
  }
74
74
  /** A set of buttons a push names through its category id. */
75
75
  export interface PushCategory {
@@ -80,7 +80,7 @@ export interface PushCategory {
80
80
  export interface PushAction {
81
81
  actionId: string;
82
82
  /** What the person typed, for a `textInput` action. */
83
- userText?: string;
83
+ userText?: string | undefined;
84
84
  data: Record<string, string>;
85
85
  /** The notification's identifier on the phone, not a server id in `data`. */
86
86
  notificationId: string;
@@ -89,7 +89,7 @@ export type PushActionHandler = (action: PushAction) => Promise<void> | void;
89
89
  export interface PushLocalNotification {
90
90
  title: string;
91
91
  body: string;
92
- data?: Record<string, string>;
92
+ data?: Record<string, string> | undefined;
93
93
  }
94
94
  export interface PushState {
95
95
  status: PushStatus;
@@ -111,24 +111,24 @@ interface NotificationLike {
111
111
  identifier: string;
112
112
  /** A background task receives the raw content, where data may still be a JSON `dataString`. */
113
113
  content: {
114
- title?: string | null;
115
- body?: string | null;
116
- data?: Record<string, unknown> | null;
117
- dataString?: string;
114
+ title?: string | null | undefined;
115
+ body?: string | null | undefined;
116
+ data?: Record<string, unknown> | null | undefined;
117
+ dataString?: string | undefined;
118
118
  };
119
119
  /** A remote push carries its raw payload: APNs `userInfo` on iOS, the FCM message on Android. */
120
120
  trigger?: {
121
- type?: string;
122
- payload?: Record<string, unknown> | null;
121
+ type?: string | undefined;
122
+ payload?: Record<string, unknown> | null | undefined;
123
123
  remoteMessage?: {
124
- data?: Record<string, unknown> | null;
125
- } | null;
126
- } | null;
124
+ data?: Record<string, unknown> | null | undefined;
125
+ } | null | undefined;
126
+ } | null | undefined;
127
127
  };
128
128
  }
129
129
  interface NotificationResponseLike {
130
130
  actionIdentifier: string;
131
- userText?: string;
131
+ userText?: string | undefined;
132
132
  notification: NotificationLike;
133
133
  }
134
134
  interface NotificationActionLike {
@@ -137,7 +137,7 @@ interface NotificationActionLike {
137
137
  textInput?: {
138
138
  submitButtonTitle: string;
139
139
  placeholder: string;
140
- };
140
+ } | undefined;
141
141
  options: {
142
142
  opensAppToForeground: boolean;
143
143
  isDestructive: boolean;
@@ -158,7 +158,7 @@ export interface PushNotificationsLike {
158
158
  addNotificationResponseReceivedListener: (listener: (response: NotificationResponseLike) => void) => SubscriptionLike;
159
159
  addNotificationReceivedListener: (listener: (notification: NotificationLike) => void) => SubscriptionLike;
160
160
  getLastNotificationResponseAsync: () => Promise<NotificationResponseLike | null>;
161
- clearLastNotificationResponseAsync?: () => Promise<void>;
161
+ clearLastNotificationResponseAsync?: (() => Promise<void>) | undefined;
162
162
  setNotificationHandler: (handler: {
163
163
  handleNotification: () => Promise<{
164
164
  shouldShowBanner: boolean;
@@ -16,26 +16,26 @@ import { type ApiError } from "../errors";
16
16
  export type ParamsFormat = "repeat" | "brackets" | "comma";
17
17
  export interface ApiRequest {
18
18
  url: string;
19
- method?: Method;
19
+ method?: Method | undefined;
20
20
  /** The request body. FormData is sent as multipart by the client. */
21
21
  data?: unknown;
22
22
  /** Query string values; build list queries with `buildListQuery`. */
23
- params?: Record<string, unknown>;
24
- headers?: Record<string, string>;
23
+ params?: Record<string, unknown> | undefined;
24
+ headers?: Record<string, string> | undefined;
25
25
  /** Only JSON-safe types belong in the store; a blob download stays a service call. */
26
- responseType?: Extract<ResponseType, "json" | "text">;
27
- timeout?: number;
28
- silent?: boolean;
29
- expectedStatuses?: number[];
30
- paramsFormat?: ParamsFormat;
31
- public?: boolean;
26
+ responseType?: Extract<ResponseType, "json" | "text"> | undefined;
27
+ timeout?: number | undefined;
28
+ silent?: boolean | undefined;
29
+ expectedStatuses?: number[] | undefined;
30
+ paramsFormat?: ParamsFormat | undefined;
31
+ public?: boolean | undefined;
32
32
  }
33
33
  export type ApiQueryArgs = string | ApiRequest;
34
34
  /** Per-endpoint options, set as the endpoint's `extraOptions`. */
35
35
  export interface ApiExtraOptions {
36
- silent?: boolean;
37
- expectedStatuses?: number[];
38
- paramsFormat?: ParamsFormat;
36
+ silent?: boolean | undefined;
37
+ expectedStatuses?: number[] | undefined;
38
+ paramsFormat?: ParamsFormat | undefined;
39
39
  }
40
40
  /**
41
41
  * Returned as the base query's `meta`, which RTK Query copies onto the
@@ -46,7 +46,7 @@ export interface ApiExtraOptions {
46
46
  export interface ApiBaseQueryMeta {
47
47
  silent: boolean;
48
48
  /** The statuses the call's screen handles itself; the toast middleware skips a failure with one. */
49
- expectedStatuses?: number[];
49
+ expectedStatuses?: number[] | undefined;
50
50
  /** The HTTP status, or 0 when no response arrived. */
51
51
  status: number;
52
52
  }
@@ -54,7 +54,7 @@ export interface ApiBaseQueryOptions {
54
54
  /** The signed-in client every call uses by default (`userClient`). */
55
55
  client: AxiosInstance;
56
56
  /** The anonymous client for calls marked `public: true` (`publicClient`). */
57
- publicClient?: AxiosInstance;
57
+ publicClient?: AxiosInstance | undefined;
58
58
  }
59
59
  export type ApiBaseQuery = BaseQueryFn<ApiQueryArgs, unknown, ApiError, ApiExtraOptions, ApiBaseQueryMeta>;
60
60
  /**
@@ -0,0 +1,58 @@
1
+ import type { ApiError } from "../errors/extractApiError";
2
+ import type { PagedDataObject } from "./paging";
3
+ import type { PagedListPaging } from "./usePagedList";
4
+ /** What a screen can be showing for one request. A closed set: the block draws every member. */
5
+ export type DataState<T> = {
6
+ readonly status: "loading";
7
+ } | {
8
+ readonly status: "error";
9
+ readonly error: ApiError;
10
+ readonly retry: () => void;
11
+ } | {
12
+ readonly status: "empty";
13
+ readonly refreshing: boolean;
14
+ readonly refresh: () => void;
15
+ } | {
16
+ readonly status: "data";
17
+ readonly data: T;
18
+ readonly refreshing: boolean;
19
+ readonly refresh: () => void;
20
+ };
21
+ /** The members of an RTK Query hook result that useDataState reads. */
22
+ export interface QueryResultLike<T> {
23
+ readonly currentData?: T | undefined;
24
+ readonly error?: unknown;
25
+ readonly isFetching: boolean;
26
+ readonly refetch: () => unknown;
27
+ }
28
+ export interface DataStateOptions<T> {
29
+ /** Default: an array of length 0, or a PagedDataObject whose items has length 0. Anything else is never empty. */
30
+ readonly isEmpty?: (data: T) => boolean;
31
+ }
32
+ export interface InfiniteQueryResultLike<T> {
33
+ readonly currentData?: {
34
+ readonly pages: readonly PagedDataObject<T>[];
35
+ } | undefined;
36
+ readonly error?: unknown;
37
+ readonly isFetching: boolean;
38
+ readonly isFetchingNextPage: boolean;
39
+ readonly hasNextPage: boolean;
40
+ readonly isError: boolean;
41
+ readonly refetch: () => unknown;
42
+ readonly fetchNextPage: () => unknown;
43
+ }
44
+ /**
45
+ * Rules, in order:
46
+ * 1. currentData is not undefined: "empty" when isEmpty says so, else "data"; refreshing is isFetching; refresh is refetch.
47
+ * A failed refetch that still holds currentData stays here (the toast middleware reports it).
48
+ * 2. error is set: "error", with error passed through extractApiError and retry calling refetch.
49
+ * 3. otherwise "loading" (first load, a skipped query, an argument that changed).
50
+ * The returned object is memoised on currentData, error, isFetching, refetch and isEmpty.
51
+ */
52
+ export declare function useDataState<T>(result: QueryResultLike<T>, options?: DataStateOptions<T>): DataState<T>;
53
+ /** state: every loaded page's items in order, "empty" when there are none. paging: what the paged list footer reads. */
54
+ export declare function useInfiniteDataState<T>(result: InfiniteQueryResultLike<T>): {
55
+ readonly state: DataState<readonly T[]>;
56
+ readonly paging: PagedListPaging;
57
+ };
58
+ //# sourceMappingURL=dataState.d.ts.map
@@ -1,6 +1,8 @@
1
1
  export type { ApiBaseQuery, ApiBaseQueryMeta, ApiBaseQueryOptions, ApiExtraOptions, ApiQueryArgs, ApiRequest, } from "./apiBaseQuery";
2
2
  export { createApiBaseQuery } from "./apiBaseQuery";
3
3
  export { APP_API_DEFAULTS, createAppApi } from "./createAppApi";
4
+ export type { DataState, DataStateOptions, InfiniteQueryResultLike, QueryResultLike } from "./dataState";
5
+ export { useDataState, useInfiniteDataState } from "./dataState";
4
6
  export { setupApiListeners } from "./listeners";
5
7
  export type { ListFilterValue, ListQuery, PagedDataObject, PagedListRequest, SortOrder, } from "./paging";
6
8
  export { buildListQuery, getNextPageParam, getPreviousPageParam, hasNextPage, hasPreviousPage, } from "./paging";
@@ -9,5 +11,5 @@ export { createPersistedQueries, PERSISTED_QUERIES_RESTORED } from "./persistedQ
9
11
  export type { ApiTag, TagId } from "./tags";
10
12
  export { itemTag, LIST_TAG_ID, listTag, providesList, providesPagedList } from "./tags";
11
13
  export type { PagedListPaging, PagedListResult, UsePagedListOptions, } from "./usePagedList";
12
- export { pagingFromInfiniteQuery, usePagedList } from "./usePagedList";
14
+ export { usePagedList } from "./usePagedList";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -14,14 +14,14 @@ export interface PagedDataObject<T> {
14
14
  }
15
15
  export type SortOrder = "asc" | "desc";
16
16
  export interface PagedListRequest {
17
- page?: number;
18
- pageSize?: number;
19
- sortBy?: string;
20
- sortOrder?: SortOrder;
17
+ page?: number | undefined;
18
+ pageSize?: number | undefined;
19
+ sortBy?: string | undefined;
20
+ sortOrder?: SortOrder | undefined;
21
21
  }
22
22
  export type ListFilterValue = string | number | boolean | null | undefined;
23
23
  export interface ListQuery extends PagedListRequest {
24
- filters?: Record<string, ListFilterValue>;
24
+ filters?: Record<string, ListFilterValue> | undefined;
25
25
  }
26
26
  /**
27
27
  * The `params` for a list endpoint. Filters sit beside the paging keys, as the
@@ -1,16 +1,16 @@
1
1
  import type { Dispatch, Middleware, UnknownAction } from "@reduxjs/toolkit";
2
- import type { CombinedState } from "@reduxjs/toolkit/query";
2
+ import type { CombinedState, EndpointDefinitions } from "@reduxjs/toolkit/query";
3
3
  export declare const PERSISTED_QUERIES_RESTORED = "@webority/mobile-core/query/persistedQueriesRestored";
4
- export interface PersistedQueriesOptions {
4
+ export interface PersistedQueriesOptions<R extends string = "api"> {
5
5
  storageKey: string;
6
6
  endpoints: readonly string[];
7
- reducerPath?: string;
7
+ reducerPath?: R | undefined;
8
8
  }
9
- type RehydratedState = CombinedState<any, any, any>;
10
- export interface PersistedQueries {
9
+ type RehydratedState<R extends string = string> = CombinedState<EndpointDefinitions, string, R>;
10
+ export interface PersistedQueries<R extends string = "api"> {
11
11
  extractRehydrationInfo: (action: UnknownAction, meta: {
12
12
  reducerPath: string;
13
- }) => RehydratedState | undefined;
13
+ }) => RehydratedState<R> | undefined;
14
14
  middleware: Middleware;
15
15
  restore: (dispatch: Dispatch) => Promise<void>;
16
16
  clear: () => Promise<void>;
@@ -21,6 +21,11 @@ export interface PersistedQueries {
21
21
  * middleware, call `restore` once after the store is created, and call `clear`
22
22
  * on sign-out so the next person on the phone never sees the last person's data.
23
23
  */
24
- export declare const createPersistedQueries: (options: PersistedQueriesOptions) => PersistedQueries;
24
+ export declare function createPersistedQueries(options: PersistedQueriesOptions<"api"> & {
25
+ reducerPath?: undefined;
26
+ }): PersistedQueries<"api">;
27
+ export declare function createPersistedQueries<R extends string>(options: PersistedQueriesOptions<R> & {
28
+ reducerPath: R;
29
+ }): PersistedQueries<R>;
25
30
  export {};
26
31
  //# sourceMappingURL=persistedQueries.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { type ApiError } from "../errors";
2
+ import type { DataState } from "./dataState";
2
3
  import type { ListFilterValue, ListQuery, PagedDataObject, SortOrder } from "./paging";
3
4
  export interface PagedListPaging {
4
5
  hasMore: boolean;
@@ -9,27 +10,18 @@ export interface PagedListPaging {
9
10
  }
10
11
  export interface UsePagedListOptions<T> {
11
12
  fetchPage: (query: ListQuery, signal: AbortSignal) => Promise<PagedDataObject<T>>;
12
- pageSize?: number;
13
- filters?: Record<string, ListFilterValue>;
14
- sortBy?: string;
15
- sortOrder?: SortOrder;
16
- enabled?: boolean;
13
+ pageSize?: number | undefined;
14
+ filters?: Record<string, ListFilterValue> | undefined;
15
+ sortBy?: string | undefined;
16
+ sortOrder?: SortOrder | undefined;
17
+ enabled?: boolean | undefined;
18
+ /** Called when a refresh or next-page load fails while items are shown; the items stay. */
19
+ onRefreshError?: ((error: ApiError) => void) | undefined;
17
20
  }
18
21
  export interface PagedListResult<T> {
19
- items: T[];
22
+ state: DataState<readonly T[]>;
20
23
  totalCount: number;
21
- loading: boolean;
22
- refreshing: boolean;
23
- error: ApiError | null;
24
- refresh: () => Promise<void>;
25
24
  paging: PagedListPaging;
26
25
  }
27
26
  export declare function usePagedList<T>(options: UsePagedListOptions<T>): PagedListResult<T>;
28
- export declare function pagingFromInfiniteQuery(result: {
29
- hasNextPage: boolean;
30
- isFetchingNextPage: boolean;
31
- isError: boolean;
32
- error?: unknown;
33
- fetchNextPage: () => unknown;
34
- }): PagedListPaging;
35
27
  //# sourceMappingURL=usePagedList.d.ts.map
@@ -40,13 +40,13 @@ export type OnRejected = (action: UnknownAction, error: ApiError, api: Middlewar
40
40
  export interface ErrorToastOptions {
41
41
  showToast: ShowErrorToast;
42
42
  /** Server `code` values a screen answers in its own way (a paywall, a terms gate). */
43
- ignoreCodes?: readonly string[];
43
+ ignoreCodes?: readonly string[] | undefined;
44
44
  /** HTTP statuses never toasted. Default `[401]`. */
45
- ignoreStatuses?: readonly number[];
45
+ ignoreStatuses?: readonly number[] | undefined;
46
46
  /** Window in which an identical message is shown once. Default 4000 ms; 0 disables. */
47
- dedupeMs?: number;
47
+ dedupeMs?: number | undefined;
48
48
  /** Decides one rejection before the default rules; see the module comment. */
49
- onRejected?: OnRejected;
49
+ onRejected?: OnRejected | undefined;
50
50
  }
51
51
  type Dict = Record<string, unknown>;
52
52
  /** Is this a rejected createAsyncThunk or RTK Query action that asked not to be toasted? */
@@ -7,7 +7,7 @@ import { type ActionFromReducersMapObject, type Reducer, type ReducersMapObject,
7
7
  export declare const resetState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"app/resetState">;
8
8
  export interface RootReducerOptions<K extends string> {
9
9
  /** Slices that survive a reset because they belong to the device, not the user (theme, onboarding seen). */
10
- preserve?: readonly K[];
10
+ preserve?: readonly K[] | undefined;
11
11
  }
12
12
  /**
13
13
  * `combineReducers(reducers)` that answers `resetState` by handing every slice `undefined`,
@@ -4,7 +4,7 @@ export declare const DEFAULT_REVIEW_COOL_DOWN_DAYS = 90;
4
4
  export declare const REVIEW_PROMPT_STORAGE_KEY = "@webority/review-prompt";
5
5
  export interface ReviewPromptOptions {
6
6
  /** Days to wait after a prompt before the next one. Defaults to 90, the minimum. */
7
- coolDownDays?: number;
7
+ coolDownDays?: number | undefined;
8
8
  }
9
9
  /** What was stored when the prompt last showed. */
10
10
  export interface ReviewPromptRecord {
@@ -4,7 +4,7 @@ export interface SecureScreenOptions {
4
4
  * `useIsFocused()`, so a secure screen left underneath a pushed screen stops
5
5
  * blocking. Default `true`: block for as long as the component is mounted.
6
6
  */
7
- focused?: boolean;
7
+ focused?: boolean | undefined;
8
8
  }
9
9
  /**
10
10
  * Blocks capture while the calling screen is focused and releases it on blur
@@ -16,9 +16,9 @@ export declare class ShareError extends Error {
16
16
  }
17
17
  export interface ShareFileOptions {
18
18
  /** Picks the apps Android offers; mapped to a UTI for iOS where one is known. */
19
- mimeType?: string;
19
+ mimeType?: string | undefined;
20
20
  /** The share sheet's title on Android. */
21
- dialogTitle?: string;
21
+ dialogTitle?: string | undefined;
22
22
  }
23
23
  /**
24
24
  * Hands a local file (the `path` `downloadFile` returns) to the share sheet.
@@ -9,7 +9,7 @@
9
9
  export interface SqliteResultSet {
10
10
  rows: Record<string, unknown>[];
11
11
  rowsAffected: number;
12
- insertId?: number;
12
+ insertId?: number | undefined;
13
13
  }
14
14
  export interface SqliteDatabase {
15
15
  execute: (sql: string, params?: readonly unknown[]) => Promise<SqliteResultSet>;
@@ -17,7 +17,7 @@ export interface SqliteDatabase {
17
17
  }
18
18
  export interface SqliteDriver {
19
19
  open: (name: string, options?: {
20
- location?: string;
20
+ location?: string | undefined;
21
21
  }) => Promise<SqliteDatabase>;
22
22
  }
23
23
  /**
@@ -49,7 +49,7 @@ export declare const whereIn: (column: string, values: readonly unknown[]) => {
49
49
  };
50
50
  export interface RawWhere {
51
51
  sql: string;
52
- params?: readonly unknown[];
52
+ params?: readonly unknown[] | undefined;
53
53
  }
54
54
  /**
55
55
  * Either a map of column to value (ANDed, `null` meaning IS NULL) or a raw
@@ -57,13 +57,13 @@ export interface RawWhere {
57
57
  */
58
58
  export type Where = Record<string, unknown> | RawWhere;
59
59
  export interface FindOptions {
60
- orderBy?: string;
61
- limit?: number;
62
- offset?: number;
60
+ orderBy?: string | undefined;
61
+ limit?: number | undefined;
62
+ offset?: number | undefined;
63
63
  }
64
64
  export interface Migration {
65
65
  version: number;
66
- name?: string;
66
+ name?: string | undefined;
67
67
  up: string | string[] | ((tx: Pick<Db, "execute">) => Promise<void>);
68
68
  }
69
69
  export interface MigrateOptions {
@@ -71,21 +71,24 @@ export interface MigrateOptions {
71
71
  * Skip the downgrade guard. Only set this when the app knows the older code
72
72
  * can read the newer schema.
73
73
  */
74
- allowDowngrade?: boolean;
74
+ allowDowngrade?: boolean | undefined;
75
75
  }
76
76
  export declare const DEFAULT_PRAGMAS: Readonly<Record<string, string | number>>;
77
77
  export interface OpenDatabaseOptions {
78
- location?: string;
78
+ location?: string | undefined;
79
79
  /**
80
80
  * Merged over DEFAULT_PRAGMAS and applied on open. Pass `false` to apply none.
81
81
  */
82
- pragmas?: Record<string, string | number> | false;
82
+ pragmas?: Record<string, string | number> | false | undefined;
83
83
  }
84
+ export type SqlRow = Readonly<Record<string, unknown>>;
84
85
  export interface Db {
85
86
  readonly name: string;
86
87
  execute: (sql: string, params?: readonly unknown[]) => Promise<SqliteResultSet>;
87
- select: <T = Record<string, unknown>>(sql: string, params?: readonly unknown[]) => Promise<T[]>;
88
- selectOne: <T = Record<string, unknown>>(sql: string, params?: readonly unknown[]) => Promise<T | null>;
88
+ select(sql: string, params?: readonly unknown[]): Promise<SqlRow[]>;
89
+ select<T>(sql: string, params: readonly unknown[] | undefined, parse: (row: SqlRow) => T): Promise<T[]>;
90
+ selectOne(sql: string, params?: readonly unknown[]): Promise<SqlRow | null>;
91
+ selectOne<T>(sql: string, params: readonly unknown[] | undefined, parse: (row: SqlRow) => T): Promise<T | null>;
89
92
  /**
90
93
  * Runs `work` alone on the connection: every other call on this database
91
94
  * waits until it commits or rolls back. Inside `work` use only `tx`; a call
@@ -97,15 +100,17 @@ export interface Db {
97
100
  update: (table: string, values: Record<string, unknown>, where: Where) => Promise<number>;
98
101
  remove: (table: string, where: Where) => Promise<number>;
99
102
  upsert: (table: string, row: Record<string, unknown>, conflictColumns: string[]) => Promise<void>;
100
- findAll: <T = Record<string, unknown>>(table: string, where?: Where, options?: FindOptions) => Promise<T[]>;
101
- findOne: <T = Record<string, unknown>>(table: string, where?: Where) => Promise<T | null>;
103
+ findAll(table: string, where?: Where, options?: FindOptions): Promise<SqlRow[]>;
104
+ findAll<T>(table: string, where: Where | undefined, options: FindOptions | undefined, parse: (row: SqlRow) => T): Promise<T[]>;
105
+ findOne(table: string, where?: Where): Promise<SqlRow | null>;
106
+ findOne<T>(table: string, where: Where | undefined, parse: (row: SqlRow) => T): Promise<T | null>;
102
107
  count: (table: string, where?: Where) => Promise<number>;
103
108
  tableExists: (table: string) => Promise<boolean>;
104
109
  createTable: (table: string, columns: Record<string, string>, options?: {
105
- ifNotExists?: boolean;
110
+ ifNotExists?: boolean | undefined;
106
111
  }) => Promise<void>;
107
112
  dropTable: (table: string, options?: {
108
- ifExists?: boolean;
113
+ ifExists?: boolean | undefined;
109
114
  }) => Promise<void>;
110
115
  wipe: () => Promise<void>;
111
116
  reset: (migrations: Migration[]) => Promise<number>;
@@ -19,14 +19,14 @@ interface AsyncStorageLike {
19
19
  * AsyncStorage 3, so recognising only the v1 names put every consumer on N
20
20
  * round-trips per batch with nothing to notice.
21
21
  */
22
- getMany?: (keys: string[]) => Promise<Record<string, string | null>>;
23
- setMany?: (entries: Record<string, string>) => Promise<void>;
24
- removeMany?: (keys: string[]) => Promise<void>;
25
- multiGet?: (keys: readonly string[]) => Promise<readonly [string, string | null][]>;
26
- multiSet?: (kvs: readonly [string, string][]) => Promise<void>;
27
- multiRemove?: (keys: readonly string[]) => Promise<void>;
28
- clear?: () => Promise<void>;
29
- getAllKeys?: () => Promise<readonly string[]>;
22
+ getMany?: ((keys: string[]) => Promise<Record<string, string | null>>) | undefined;
23
+ setMany?: ((entries: Record<string, string>) => Promise<void>) | undefined;
24
+ removeMany?: ((keys: string[]) => Promise<void>) | undefined;
25
+ multiGet?: ((keys: string[]) => Promise<readonly [string, string | null][]>) | undefined;
26
+ multiSet?: ((kvs: [string, string][]) => Promise<void>) | undefined;
27
+ multiRemove?: ((keys: string[]) => Promise<void>) | undefined;
28
+ clear?: (() => Promise<void>) | undefined;
29
+ getAllKeys?: (() => Promise<readonly string[]>) | undefined;
30
30
  }
31
31
  /**
32
32
  * Always true now that the backend ships with the library. Kept because callers
@@ -43,7 +43,7 @@ export interface StorageApi {
43
43
  getItem: (key: string) => Promise<string | null>;
44
44
  setItem: (key: string, value: string) => Promise<boolean>;
45
45
  removeItem: (key: string) => Promise<boolean>;
46
- getJson: <T>(key: string) => Promise<T | null>;
46
+ getJson: <T>(key: string, parse: (value: unknown) => T) => Promise<T | null>;
47
47
  setJson: <T>(key: string, value: T) => Promise<boolean>;
48
48
  multiGet: (keys: readonly string[]) => Promise<Record<string, string | null>>;
49
49
  multiSet: (entries: Record<string, string>) => Promise<boolean>;