cross-state 0.33.2 → 0.33.3

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.
@@ -43,13 +43,16 @@ export type Update<Value> = UpdateFrom<Value, [Value]>;
43
43
  export interface UpdateFunction<Value> {
44
44
  (update: Update<Value>): void;
45
45
  }
46
+ export interface AsyncUpdateFunction<Value> {
47
+ (update: UpdateFrom<MaybePromise<Value>, [Value]>): void;
48
+ }
46
49
  export interface Use {
47
50
  <T>(store: Store<T>): T;
48
51
  }
49
52
  export type ConnectionState = 'connecting' | 'open' | 'closing' | 'closed';
50
53
  export interface CalculationHelpers<T> {
51
54
  use: Use;
52
- updateValue: (update: UpdateFrom<MaybePromise<T>, [T]>) => void;
55
+ updateValue: AsyncUpdateFunction<T>;
53
56
  updateError: (error: unknown) => void;
54
57
  updateConnectionState: (state: ConnectionState) => void;
55
58
  }
@@ -1,5 +1,5 @@
1
1
  export { Cache, createCache, type CacheFunction, type CacheGetOptions, type CacheOptions, } from './cache';
2
- export type { Cancel, Duration, Effect, Listener, SubscribeOptions } from './commonTypes';
2
+ export type { Cancel, Duration, Effect, Listener, SubscribeOptions, AsyncUpdateFunction, ConnectionState, Selector, Update, UpdateFrom, UpdateFunction, } from './commonTypes';
3
3
  export { ResourceGroup, allResources, createResourceGroup, type Resource } from './resourceGroup';
4
4
  export { Scope, createScope } from './scope';
5
5
  export { Store, createStore, type BoundStoreMethods, type StoreMethods, type StoreOptions, type StoreOptionsWithMethods, } from './store';
@@ -21,8 +21,8 @@ declare const scopeMethods: {
21
21
  useScope<T>(this: Scope<T>): Store<T>;
22
22
  useStore<T_1>(this: Scope<T_1>, options?: UseStoreOptions<T_1> | undefined): T_1;
23
23
  useProp<T_2>(this: Scope<T_2>, options?: UseStoreOptions<T_2> | undefined): [value: T_2, setValue: {
24
- (update: import("../core/commonTypes").Update<T_2>): void;
25
- <const P extends import("..").Path<T_2>>(path: P, update: import("../core/commonTypes").Update<import("..").Value<T_2, P>>): void;
24
+ (update: import("../core").Update<T_2>): void;
25
+ <const P extends import("..").Path<T_2>>(path: P, update: import("../core").Update<import("..").Value<T_2, P>>): void;
26
26
  }];
27
27
  Provider<T_3>(this: Scope<T_3>, props: Omit<ScopeProps<T_3>, "scope">): import("react/jsx-runtime").JSX.Element;
28
28
  };
@@ -16,6 +16,6 @@ export declare function ScopeProvider<T>({ scope, store: inputStore, children }:
16
16
  export declare function useScope<T>(scope: Scope<T>): Store<T>;
17
17
  export declare function useScopeStore<T>(scope: Scope<T>, options?: UseStoreOptions<T>): T;
18
18
  export declare function useScopeProp<T>(scope: Scope<T>, options?: UseStoreOptions<T>): [value: T, setValue: {
19
- (update: import("../core/commonTypes").Update<T>): void;
20
- <const P extends import("..").Path<T>>(path: P, update: import("../core/commonTypes").Update<import("..").Value<T, P>>): void;
19
+ (update: import("../core").Update<T>): void;
20
+ <const P extends import("..").Path<T>>(path: P, update: import("../core").Update<import("..").Value<T, P>>): void;
21
21
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-state",
3
- "version": "0.33.2",
3
+ "version": "0.33.3",
4
4
  "description": "(React) state library",
5
5
  "license": "ISC",
6
6
  "repository": "schummar/cross-state",