@legendapp/state 2.2.0-next.43 → 2.2.0-next.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/state",
3
- "version": "2.2.0-next.43",
3
+ "version": "2.2.0-next.44",
4
4
  "description": "legend-state",
5
5
  "sideEffects": false,
6
6
  "private": false,
@@ -1,4 +1,4 @@
1
- import type { GetOptions, ListenerFn, TrackingType } from './observableInterfaces';
1
+ import type { GetOptions, ListenerFn, RecordValue, TrackingType } from './observableInterfaces';
2
2
  type Primitive = string | number | boolean | symbol | bigint | undefined | null | Date;
3
3
  type ArrayOverrideFnNames = 'find' | 'every' | 'some' | 'filter' | 'reduce' | 'reduceRight' | 'forEach' | 'map' | 'sort';
4
4
  type RemoveIndex<T> = {
@@ -80,9 +80,9 @@ type ObservableNode<T, NT = NonNullable<T>> = [NT] extends [never] ? ObservableP
80
80
  type Observable<T = any> = ObservableNode<T> & {};
81
81
  type ObservableReadable<T = any> = ImmutableObservableBase<T>;
82
82
  type ObservableWriteable<T = any> = ObservableReadable<T> & MutableObservableBase<T>;
83
- type ValueOrFunction<T> = T extends Function ? T : T | (() => T | Promise<T>);
83
+ type ValueOrFunction<T> = T extends Function ? T : T | Promise<T> | (() => T | Promise<T>);
84
84
  type ValueOrFunctionKeys<T> = {
85
85
  [K in keyof T]: RecursiveValueOrFunction<T[K]>;
86
86
  };
87
- type RecursiveValueOrFunction<T> = T extends Function ? T : T extends object ? ((key: string) => string) | Promise<ValueOrFunctionKeys<T>> | ValueOrFunctionKeys<T> | ImmutableObservableBase<T> | (() => T | Promise<T> | ValueOrFunctionKeys<T> | Promise<ValueOrFunctionKeys<T>> | Observable<T>) : ValueOrFunction<T>;
87
+ type RecursiveValueOrFunction<T> = T extends Function ? T : T extends object ? ((key: string) => RecordValue<RecursiveValueOrFunction<T>>) | Promise<ValueOrFunctionKeys<T>> | ValueOrFunctionKeys<T> | ImmutableObservableBase<T> | (() => T | Promise<T> | ValueOrFunctionKeys<T> | Promise<ValueOrFunctionKeys<T>> | Observable<T>) : ValueOrFunction<T>;
88
88
  export type { Observable, ObservableBoolean, ObservableObject, ObservablePrimitive, ObservableReadable, ObservableWriteable, ImmutableObservableBase, RecursiveValueOrFunction, };