@arcote.tech/arc-react 0.7.25 → 0.7.27

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.
@@ -1,4 +1,4 @@
1
- import { CommandWire, EventWire, Model, type ArcContextAny } from "@arcote.tech/arc";
1
+ import { CommandWire, EventWire, Model, type ArcContextAny, type MutationExecutor } from "@arcote.tech/arc";
2
2
  import type { ReactModelOptions } from "../options";
3
3
  /**
4
4
  * Accessor type for useQuery() — maps element names to their query methods,
@@ -10,11 +10,10 @@ export type QueryAccessor<C extends ArcContextAny> = {
10
10
  } : never;
11
11
  };
12
12
  /**
13
- * Accessor type for useMutation() — maps element names to their mutation methods.
13
+ * Accessor type for useMutation() — the canonical mutation accessor lives in
14
+ * core (`MutationExecutor`); re-aliased here as the single source of truth.
14
15
  */
15
- export type MutationAccessor<C extends ArcContextAny> = {
16
- [E in C["elements"][number] as E["mutateContext"] extends (...args: any[]) => any ? E["name"] : never]: E["mutateContext"] extends (...args: any[]) => infer R ? R : never;
17
- };
16
+ export type MutationAccessor<C extends ArcContextAny> = MutationExecutor<C>;
18
17
  export interface ScopeAPI<C extends ArcContextAny = ArcContextAny> {
19
18
  Provider: React.FC<{
20
19
  children: React.ReactNode;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcote.tech/arc-react",
3
3
  "type": "module",
4
- "version": "0.7.25",
4
+ "version": "0.7.27",
5
5
  "private": false,
6
6
  "author": "Przemysław Krasiński [arcote.tech]",
7
7
  "description": "React client for the Arc framework, providing utilities for querying data and executing commands, enhancing the development of reactive and efficient user interfaces.",
@@ -32,7 +32,7 @@
32
32
  "typescript": "^5.2.2"
33
33
  },
34
34
  "peerDependencies": {
35
- "@arcote.tech/arc": "^0.7.25",
35
+ "@arcote.tech/arc": "^0.7.27",
36
36
  "react": "^18.0.0 || ^19.0.0",
37
37
  "react-dom": "^18.0.0 || ^19.0.0",
38
38
  "typescript": "^5.0.0"