@pyreon/state-tree 0.10.0 → 0.11.1

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/src/types.ts CHANGED
@@ -1,9 +1,9 @@
1
- import type { Computed, Signal } from '@pyreon/reactivity'
1
+ import type { Computed, Signal } from "@pyreon/reactivity"
2
2
 
3
3
  // ─── Model brand ──────────────────────────────────────────────────────────────
4
4
 
5
5
  /** Property key stamped on every ModelDefinition to distinguish it from plain objects. */
6
- export const MODEL_BRAND = '__pyreonMod' as const
6
+ export const MODEL_BRAND = "__pyreonMod" as const
7
7
 
8
8
  // ─── State type helpers ───────────────────────────────────────────────────────
9
9
 
@@ -31,8 +31,7 @@ export type StateSignals<TState extends StateShape> = {
31
31
  * strongly typed for state signals, `any` for actions and views so that
32
32
  * actions can call each other without circular type issues.
33
33
  */
34
- export type ModelSelf<TState extends StateShape> = StateSignals<TState> &
35
- Record<string, any>
34
+ export type ModelSelf<TState extends StateShape> = StateSignals<TState> & Record<string, any>
36
35
 
37
36
  /** The public instance type returned by `.create()` and hooks. */
38
37
  export type ModelInstance<
@@ -65,7 +64,7 @@ export type Snapshot<TState extends StateShape> = {
65
64
  // ─── Patch ────────────────────────────────────────────────────────────────────
66
65
 
67
66
  export interface Patch {
68
- op: 'replace'
67
+ op: "replace"
69
68
  path: string
70
69
  value: unknown
71
70
  }
@@ -83,10 +82,7 @@ export interface ActionCall {
83
82
  path: string
84
83
  }
85
84
 
86
- export type MiddlewareFn = (
87
- call: ActionCall,
88
- next: (nextCall: ActionCall) => unknown,
89
- ) => unknown
85
+ export type MiddlewareFn = (call: ActionCall, next: (nextCall: ActionCall) => unknown) => unknown
90
86
 
91
87
  // ─── Instance metadata ────────────────────────────────────────────────────────
92
88