yummies 7.10.0 → 7.12.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 (154) hide show
  1. package/async.cjs +162 -48
  2. package/async.cjs.map +1 -1
  3. package/async.d.ts +112 -13
  4. package/async.js +163 -54
  5. package/async.js.map +1 -1
  6. package/chunk-CVq3Gv4J.cjs +50 -0
  7. package/chunk-YKewjYmz.js +37 -0
  8. package/common.cjs +48 -8
  9. package/common.cjs.map +1 -1
  10. package/common.d.ts +35 -2
  11. package/common.js +49 -11
  12. package/common.js.map +1 -1
  13. package/complex.cjs +275 -104
  14. package/complex.cjs.map +1 -1
  15. package/complex.d.ts +133 -13
  16. package/complex.js +275 -109
  17. package/complex.js.map +1 -1
  18. package/cookie.cjs +17 -7
  19. package/cookie.cjs.map +1 -1
  20. package/cookie.d.ts +8 -0
  21. package/cookie.js +18 -9
  22. package/cookie.js.map +1 -1
  23. package/css.cjs +147 -39
  24. package/css.cjs.map +1 -1
  25. package/css.d.ts +98 -6
  26. package/css.js +143 -41
  27. package/css.js.map +1 -1
  28. package/data.cjs +90 -55
  29. package/data.cjs.map +1 -1
  30. package/data.d.ts +32 -0
  31. package/data.js +91 -61
  32. package/data.js.map +1 -1
  33. package/date-time.cjs +578 -412
  34. package/date-time.cjs.map +1 -1
  35. package/date-time.d.ts +88 -0
  36. package/date-time.js +575 -421
  37. package/date-time.js.map +1 -1
  38. package/device.cjs +48 -23
  39. package/device.cjs.map +1 -1
  40. package/device.d.ts +32 -0
  41. package/device.js +49 -31
  42. package/device.js.map +1 -1
  43. package/encodings.cjs +275 -266
  44. package/encodings.cjs.map +1 -1
  45. package/encodings.d.ts +8 -0
  46. package/encodings.js +276 -268
  47. package/encodings.js.map +1 -1
  48. package/errors.cjs +20 -18
  49. package/errors.cjs.map +1 -1
  50. package/errors.js +19 -19
  51. package/errors.js.map +1 -1
  52. package/file.cjs +42 -24
  53. package/file.cjs.map +1 -1
  54. package/file.d.ts +16 -0
  55. package/file.js +43 -27
  56. package/file.js.map +1 -1
  57. package/format.cjs +125 -83
  58. package/format.cjs.map +1 -1
  59. package/format.d.ts +89 -4
  60. package/format.js +118 -82
  61. package/format.js.map +1 -1
  62. package/html.cjs +226 -137
  63. package/html.cjs.map +1 -1
  64. package/html.d.ts +67 -3
  65. package/html.js +223 -150
  66. package/html.js.map +1 -1
  67. package/id.cjs +74 -17
  68. package/id.cjs.map +1 -1
  69. package/id.d.ts +10 -10
  70. package/id.js +73 -24
  71. package/id.js.map +1 -1
  72. package/imports.cjs +41 -29
  73. package/imports.cjs.map +1 -1
  74. package/imports.d.ts +13 -4
  75. package/imports.js +40 -31
  76. package/imports.js.map +1 -1
  77. package/math.cjs +32 -6
  78. package/math.cjs.map +1 -1
  79. package/math.d.ts +17 -1
  80. package/math.js +33 -10
  81. package/math.js.map +1 -1
  82. package/media.cjs +275 -84
  83. package/media.cjs.map +1 -1
  84. package/media.d.ts +188 -2
  85. package/media.js +274 -93
  86. package/media.js.map +1 -1
  87. package/mobx.cjs +353 -193
  88. package/mobx.cjs.map +1 -1
  89. package/mobx.d.ts +172 -6
  90. package/mobx.js +351 -200
  91. package/mobx.js.map +1 -1
  92. package/ms.cjs +21 -10
  93. package/ms.cjs.map +1 -1
  94. package/ms.d.ts +1 -1
  95. package/ms.js +22 -13
  96. package/ms.js.map +1 -1
  97. package/number.cjs +13 -7
  98. package/number.cjs.map +1 -1
  99. package/number.js +14 -9
  100. package/number.js.map +1 -1
  101. package/package.json +13 -5
  102. package/parser.cjs +117 -64
  103. package/parser.cjs.map +1 -1
  104. package/parser.d.ts +63 -0
  105. package/parser.js +111 -64
  106. package/parser.js.map +1 -1
  107. package/price.cjs +24 -18
  108. package/price.cjs.map +1 -1
  109. package/price.d.ts +8 -0
  110. package/price.js +25 -20
  111. package/price.js.map +1 -1
  112. package/random.cjs +79 -13
  113. package/random.cjs.map +1 -1
  114. package/random.d.ts +64 -0
  115. package/random.js +80 -22
  116. package/random.js.map +1 -1
  117. package/react.cjs +673 -214
  118. package/react.cjs.map +1 -1
  119. package/react.d.ts +428 -9
  120. package/react.js +674 -239
  121. package/react.js.map +1 -1
  122. package/sound.cjs +14 -9
  123. package/sound.cjs.map +1 -1
  124. package/sound.d.ts +1 -1
  125. package/sound.js +15 -11
  126. package/sound.js.map +1 -1
  127. package/storage.cjs +49 -50
  128. package/storage.cjs.map +1 -1
  129. package/storage.d.ts +15 -6
  130. package/storage.js +50 -53
  131. package/storage.js.map +1 -1
  132. package/text.cjs +51 -34
  133. package/text.cjs.map +1 -1
  134. package/text.d.ts +5 -5
  135. package/text.js +52 -37
  136. package/text.js.map +1 -1
  137. package/type-guard.cjs +292 -72
  138. package/type-guard.cjs.map +1 -1
  139. package/type-guard.d.ts +199 -42
  140. package/type-guard.js +288 -73
  141. package/type-guard.js.map +1 -1
  142. package/types.cjs +0 -2
  143. package/types.global.cjs +0 -2
  144. package/types.global.js +0 -2
  145. package/types.js +0 -2
  146. package/vibrate.cjs +31 -6
  147. package/vibrate.cjs.map +1 -1
  148. package/vibrate.d.ts +23 -1
  149. package/vibrate.js +32 -8
  150. package/vibrate.js.map +1 -1
  151. package/types.cjs.map +0 -1
  152. package/types.global.cjs.map +0 -1
  153. package/types.global.js.map +0 -1
  154. package/types.js.map +0 -1
package/mobx.d.ts CHANGED
@@ -5,14 +5,51 @@ type ObservableAnnotationsArray<T extends AnyObject = AnyObject> = [
5
5
  AnnotationMapEntry,
6
6
  ...(keyof T | (string & {}))[]
7
7
  ][];
8
+ /**
9
+ * Applies a compact list of MobX annotations to an object using either
10
+ * decorator-style invocation or the annotation map form accepted by `makeObservable`.
11
+ *
12
+ * @template T Target object type.
13
+ * @param context Object that should become observable.
14
+ * @param annotationsArray Tuples of annotation followed by annotated field names.
15
+ * @param useDecorators Enables decorator-style application before calling `makeObservable`.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * applyObservable(store, [[observable, 'items'], [action, 'setItems']]);
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * applyObservable(viewModel, [[computed, 'fullName']], true);
25
+ * ```
26
+ */
8
27
  declare const applyObservable: <T extends AnyObject>(context: T, annotationsArray: ObservableAnnotationsArray<T>, useDecorators?: boolean) => void;
9
28
 
10
29
  interface IEnhancedAtom<TMeta extends AnyObject = AnyObject> extends IAtom {
11
30
  meta: TMeta;
12
31
  }
13
32
  /**
14
- * Creates an enhanced atom with meta data
15
- * And bind `reportChanged` and `reportObserved` method to the atom
33
+ * Creates a MobX atom extended with metadata and bound reporting methods.
34
+ *
35
+ * @template TMeta Metadata object stored on the atom.
36
+ * @param name Atom name used by MobX for debugging.
37
+ * @param onBecomeObservedHandler Callback fired when the atom becomes observed.
38
+ * @param onBecomeUnobservedHandler Callback fired when the atom is no longer observed.
39
+ * @param meta Optional metadata attached to the atom.
40
+ * @returns Atom instance with `meta`, `reportChanged` and `reportObserved`.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const atom = createEnhancedAtom('user-status');
45
+ * atom.reportChanged();
46
+ * ```
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const atom = createEnhancedAtom('cache', undefined, undefined, { scope: 'users' });
51
+ * atom.meta.scope;
52
+ * ```
16
53
  */
17
54
  declare const createEnhancedAtom: <TMeta extends AnyObject>(name: string, onBecomeObservedHandler?: (atom: IEnhancedAtom<TMeta>) => void, onBecomeUnobservedHandler?: (atom: IEnhancedAtom<TMeta>) => void, meta?: TMeta) => IEnhancedAtom<TMeta>;
18
55
 
@@ -43,12 +80,97 @@ interface CreateRefConfig<T = any, TMeta = AnyObject> {
43
80
  comparer?: IEqualsComparer<T | null>;
44
81
  }
45
82
  /**
46
- * Creates ref thing to attach HTMLElements in React and all other
83
+ * Creates a MobX-aware ref that behaves like a callback ref and exposes
84
+ * observable `current` and `meta` fields.
85
+ *
86
+ * @template T Referenced value type.
87
+ * @template TMeta Additional observable metadata stored on the ref.
88
+ * @param cfg Optional callbacks, initial value and comparer configuration.
89
+ * @returns Observable ref function object.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const inputRef = createRef<HTMLInputElement>();
94
+ * inputRef.set(document.createElement('input'));
95
+ * ```
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * const ref = createRef<number>();
100
+ * ref(3);
101
+ * ref.current; // 3
102
+ * ```
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * const nodeRef = createRef({
107
+ * onUnset: () => console.log('detached'),
108
+ * meta: { mounted: false },
109
+ * });
110
+ * ```
47
111
  */
48
112
  declare const createRef: <T = any, TMeta = AnyObject>(cfg?: CreateRefConfig<T, TMeta>) => Ref<T, TMeta>;
113
+ /**
114
+ * Checks whether the provided value is a ref created by `createRef`.
115
+ *
116
+ * @template T Referenced value type.
117
+ * @template TMeta Ref metadata type.
118
+ * @param value Value to inspect.
119
+ * @returns `true` when the value is a ref-like function with `current`.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const ref = createRef<number>();
124
+ * isRef(ref); // true
125
+ * ```
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * isRef({ current: 1 }); // false
130
+ * ```
131
+ */
49
132
  declare const isRef: <T, TMeta = any>(value: T | Ref<T, TMeta>) => value is Ref<T, TMeta>;
133
+ /**
134
+ * Normalizes a plain value or an existing ref into a `Ref` instance.
135
+ *
136
+ * @template T Referenced value type.
137
+ * @template TMeta Ref metadata type.
138
+ * @param value Existing ref or initial plain value.
139
+ * @param cfg Optional ref configuration applied when a new ref is created.
140
+ * @returns Existing ref or a newly created ref initialized with `value`.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const ref = toRef(document.body);
145
+ * ref.current === document.body;
146
+ * ```
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * const existingRef = createRef<number>();
151
+ * const sameRef = toRef(existingRef);
152
+ * ```
153
+ */
50
154
  declare const toRef: <T, TMeta = any>(value: T | Ref<T, TMeta>, cfg?: Omit<CreateRefConfig<T, TMeta>, "initial">) => Ref<T, TMeta>;
51
155
 
156
+ /**
157
+ * Wraps a plain object into a deeply observable structure and allows
158
+ * patch-like updates while preserving nested observable references where possible.
159
+ *
160
+ * @template TData Observable object shape.
161
+ *
162
+ * @example
163
+ * ```ts
164
+ * const state = new DeepObservableStruct({ user: { name: 'Ann' } });
165
+ * state.set({ user: { name: 'Bob' } });
166
+ * ```
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * const state = new DeepObservableStruct({ filters: { active: true } });
171
+ * state.set({ filters: { active: false, archived: true } });
172
+ * ```
173
+ */
52
174
  declare class DeepObservableStruct<TData extends AnyObject> {
53
175
  data: TData;
54
176
  constructor(data: TData);
@@ -56,13 +178,57 @@ declare class DeepObservableStruct<TData extends AnyObject> {
56
178
  }
57
179
 
58
180
  type ObservableObjectAdministration = Parameters<Exclude<AnnotationMapEntry, boolean>['make_']>[0];
181
+ /**
182
+ * Returns the internal MobX administration object associated with an observable target.
183
+ *
184
+ * @param context Observable object instance.
185
+ * @returns MobX administration internals stored under `$mobx`.
186
+ *
187
+ * @example
188
+ * ```ts
189
+ * const admin = getMobxAdministration(store);
190
+ * admin.name_;
191
+ * ```
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * const values = getMobxAdministration(formState).values_;
196
+ * ```
197
+ */
59
198
  declare const getMobxAdministration: (context: AnyObject) => ObservableObjectAdministration;
60
199
 
61
200
  /**
62
- * When ONE OF the properties is becomes observed then `onStart` function is called.
63
- * WHen ALL properties are unobserved then `onEnd` function is called with the `metaData` that was returned by `onStart`.
201
+ * Starts side effects only while one or more MobX observables are being observed.
202
+ *
203
+ * When the first property becomes observed, `onStart` is called. When all tracked
204
+ * properties become unobserved, `onEnd` is called with the value returned by
205
+ * `onStart`. Cleanup can be delayed via `endDelay`.
206
+ *
207
+ * It uses MobX `onBecomeObserved` and `onBecomeUnobserved` hooks to perform
208
+ * lazy subscription management.
209
+ *
210
+ * @template TMetaData Data returned from `onStart` and forwarded to `onEnd`.
211
+ * @param config Configuration for tracked properties and lifecycle callbacks.
212
+ * @returns Cleanup function that clears the tracked state and runs `onEnd`.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const stop = lazyObserve({
217
+ * context: store,
218
+ * property: 'items',
219
+ * onStart: () => api.subscribe(),
220
+ * onEnd: (subscription) => subscription.unsubscribe(),
221
+ * });
222
+ * ```
64
223
  *
65
- * It uses `onBecomeObserved` and `onBecomeUnobserved` mobx hooks to perform lazy observation.
224
+ * @example
225
+ * ```ts
226
+ * lazyObserve({
227
+ * property: [boxA, boxB],
228
+ * onStart: () => console.log('observed'),
229
+ * endDelay: 300,
230
+ * });
231
+ * ```
66
232
  */
67
233
  declare const lazyObserve: <TMetaData = void>({ context, property, onStart, onEnd, endDelay, }: {
68
234
  context?: any;