react-native-onyx 1.0.106 → 1.0.107

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 (2) hide show
  1. package/lib/withOnyx.d.ts +11 -2
  2. package/package.json +1 -1
package/lib/withOnyx.d.ts CHANGED
@@ -7,6 +7,15 @@ import {CollectionKeyBase, KeyValueMapping, OnyxCollection, OnyxEntry, OnyxKey,
7
7
  type BaseMapping<TComponentProps, TOnyxProps> = {
8
8
  canEvict?: boolean | ((props: Omit<TComponentProps, keyof TOnyxProps>) => boolean);
9
9
  initWithStoredValues?: boolean;
10
+ allowStaleData?: boolean;
11
+ };
12
+
13
+ type CollectionBaseMapping<TOnyxKey extends CollectionKeyBase> = {
14
+ initialValue?: OnyxCollection<KeyValueMapping[TOnyxKey]>;
15
+ };
16
+
17
+ type EntryBaseMapping<TOnyxKey extends OnyxKey> = {
18
+ initialValue?: OnyxEntry<KeyValueMapping[TOnyxKey]>;
10
19
  };
11
20
 
12
21
  /**
@@ -99,7 +108,7 @@ type BaseMappingFunctionKeyAndSelector<
99
108
  type Mapping<TComponentProps, TOnyxProps, TOnyxProp extends keyof TOnyxProps, TOnyxKey extends OnyxKey> = BaseMapping<
100
109
  TComponentProps,
101
110
  TOnyxProps
102
- > &
111
+ > & EntryBaseMapping<TOnyxKey> &
103
112
  (
104
113
  | BaseMappingKey<TComponentProps, TOnyxProps, TOnyxProp, TOnyxKey, OnyxEntry<KeyValueMapping[TOnyxKey]>>
105
114
  | BaseMappingStringKeyAndSelector<TComponentProps, TOnyxProps, TOnyxProp, TOnyxKey>
@@ -114,7 +123,7 @@ type CollectionMapping<
114
123
  TOnyxProps,
115
124
  TOnyxProp extends keyof TOnyxProps,
116
125
  TOnyxKey extends CollectionKeyBase
117
- > = BaseMapping<TComponentProps, TOnyxProps> &
126
+ > = BaseMapping<TComponentProps, TOnyxProps> & CollectionBaseMapping<TOnyxKey> &
118
127
  (
119
128
  | BaseMappingKey<TComponentProps, TOnyxProps, TOnyxProp, TOnyxKey, OnyxCollection<KeyValueMapping[TOnyxKey]>>
120
129
  | BaseMappingStringKeyAndSelector<TComponentProps, TOnyxProps, TOnyxProp, TOnyxKey>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-onyx",
3
- "version": "1.0.106",
3
+ "version": "1.0.107",
4
4
  "author": "Expensify, Inc.",
5
5
  "homepage": "https://expensify.com",
6
6
  "description": "State management for React Native",