@comapeo/core-react 4.3.0 → 6.0.0-prerelease.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.
@@ -1,6 +1,6 @@
1
1
  import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
2
- import { type JSX, type ReactNode } from 'react';
3
- export declare const ClientApiContext: import("react").Context<import("@comapeo/ipc/dist/client.js", { with: { "resolution-mode": "import" } }).MapeoClientApi | null>;
2
+ import { type Context, type JSX, type ReactNode } from 'react';
3
+ export declare const ClientApiContext: Context<MapeoClientApi | null>;
4
4
  /**
5
5
  * Create a context provider that holds a CoMapeo API client instance.
6
6
  *
@@ -1,3 +1,4 @@
1
+ import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
1
2
  /**
2
3
  * Access a client API instance. If a ClientApiContext provider is not
3
4
  * set up, it will throw an error.
@@ -23,7 +24,7 @@
23
24
  * ```
24
25
  *
25
26
  */
26
- export declare function useClientApi(): import("@comapeo/ipc/dist/client.js", { with: { "resolution-mode": "import" } }).MapeoClientApi;
27
+ export declare function useClientApi(): MapeoClientApi;
27
28
  /**
28
29
  * Retrieve info about the current device.
29
30
  *
@@ -37,7 +38,7 @@ export declare function useClientApi(): import("@comapeo/ipc/dist/client.js", {
37
38
  export declare function useOwnDeviceInfo(): {
38
39
  data: {
39
40
  deviceId: string;
40
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
41
+ deviceType: import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam["deviceType"];
41
42
  } & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>;
42
43
  error: Error | null;
43
44
  isRefetching: boolean;
@@ -1,5 +1,6 @@
1
1
  import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api.js' with { 'resolution-mode': 'import' };
2
2
  import type { BlobId } from '@comapeo/core/dist/types.js' with { 'resolution-mode': 'import' };
3
+ import type { MapeoProjectApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
3
4
  import { type SyncState } from '../lib/sync.js';
4
5
  /**
5
6
  * Retrieve the project settings for a project.
@@ -39,7 +40,7 @@ export declare function useProjectSettings({ projectId }: {
39
40
  export declare function useSingleProject({ projectId }: {
40
41
  projectId: string;
41
42
  }): {
42
- data: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>;
43
+ data: MapeoProjectApi;
43
44
  error: Error | null;
44
45
  isRefetching: boolean;
45
46
  };
@@ -56,27 +57,7 @@ export declare function useSingleProject({ projectId }: {
56
57
  * ```
57
58
  */
58
59
  export declare function useManyProjects(): {
59
- data: (Pick<{
60
- schemaName: "projectSettings";
61
- name?: string | undefined;
62
- defaultPresets?: {
63
- point: string[];
64
- area: string[];
65
- vertex: string[];
66
- line: string[];
67
- relation: string[];
68
- } | undefined;
69
- configMetadata?: {
70
- name: string;
71
- buildDate: string;
72
- importDate: string;
73
- fileVersion: string;
74
- } | undefined;
75
- }, "name"> & {
76
- projectId: string;
77
- createdAt?: string | undefined;
78
- updatedAt?: string | undefined;
79
- })[];
60
+ data: import("@comapeo/core/dist/mapeo-manager.js", { with: { "resolution-mode": "import" } }).ListedProject[];
80
61
  error: Error | null;
81
62
  isRefetching: boolean;
82
63
  };
@@ -8,20 +8,20 @@ export declare function deviceInfoQueryOptions({ clientApi, }: {
8
8
  clientApi: MapeoClientApi;
9
9
  }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
10
10
  deviceId: string;
11
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
11
+ deviceType: import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam["deviceType"];
12
12
  } & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, Error, {
13
13
  deviceId: string;
14
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
14
+ deviceType: import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam["deviceType"];
15
15
  } & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"]>, "queryFn"> & {
16
16
  queryFn?: import("@tanstack/react-query").QueryFunction<{
17
17
  deviceId: string;
18
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
18
+ deviceType: import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam["deviceType"];
19
19
  } & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"], never> | undefined;
20
20
  } & {
21
21
  queryKey: readonly ["@comapeo/core-react", "client", "device_info"] & {
22
22
  [dataTagSymbol]: {
23
23
  deviceId: string;
24
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
24
+ deviceType: import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam["deviceType"];
25
25
  } & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>;
26
26
  [dataTagErrorSymbol]: Error;
27
27
  };
@@ -46,6 +46,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
46
46
  tags: {
47
47
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
48
48
  };
49
+ presetRef?: {
50
+ docId: string;
51
+ versionId: string;
52
+ } | undefined;
49
53
  docId: string;
50
54
  versionId: string;
51
55
  originalVersionId: string;
@@ -164,6 +168,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
164
168
  tags: {
165
169
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
166
170
  };
171
+ presetRef?: {
172
+ docId: string;
173
+ versionId: string;
174
+ } | undefined;
167
175
  docId: string;
168
176
  versionId: string;
169
177
  originalVersionId: string;
@@ -286,6 +294,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
286
294
  tags: {
287
295
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
288
296
  };
297
+ presetRef?: {
298
+ docId: string;
299
+ versionId: string;
300
+ } | undefined;
289
301
  docId: string;
290
302
  versionId: string;
291
303
  originalVersionId: string;
@@ -413,6 +425,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
413
425
  tags: {
414
426
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
415
427
  };
428
+ presetRef?: {
429
+ docId: string;
430
+ versionId: string;
431
+ } | undefined;
416
432
  docId: string;
417
433
  versionId: string;
418
434
  originalVersionId: string;
@@ -541,6 +557,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
541
557
  tags: {
542
558
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
543
559
  };
560
+ presetRef?: {
561
+ docId: string;
562
+ versionId: string;
563
+ } | undefined;
544
564
  docId: string;
545
565
  versionId: string;
546
566
  originalVersionId: string;
@@ -659,6 +679,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
659
679
  tags: {
660
680
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
661
681
  };
682
+ presetRef?: {
683
+ docId: string;
684
+ versionId: string;
685
+ } | undefined;
662
686
  docId: string;
663
687
  versionId: string;
664
688
  originalVersionId: string;
@@ -780,6 +804,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
780
804
  tags: {
781
805
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
782
806
  };
807
+ presetRef?: {
808
+ docId: string;
809
+ versionId: string;
810
+ } | undefined;
783
811
  docId: string;
784
812
  versionId: string;
785
813
  originalVersionId: string;
@@ -905,6 +933,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
905
933
  tags: {
906
934
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
907
935
  };
936
+ presetRef?: {
937
+ docId: string;
938
+ versionId: string;
939
+ } | undefined;
908
940
  docId: string;
909
941
  versionId: string;
910
942
  originalVersionId: string;
@@ -1033,6 +1065,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1033
1065
  tags: {
1034
1066
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1035
1067
  };
1068
+ presetRef?: {
1069
+ docId: string;
1070
+ versionId: string;
1071
+ } | undefined;
1036
1072
  docId: string;
1037
1073
  versionId: string;
1038
1074
  originalVersionId: string;
@@ -1141,6 +1177,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1141
1177
  tags: {
1142
1178
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1143
1179
  };
1180
+ presetRef?: {
1181
+ docId: string;
1182
+ versionId: string;
1183
+ } | undefined;
1144
1184
  docId: string;
1145
1185
  versionId: string;
1146
1186
  originalVersionId: string;
@@ -1252,6 +1292,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1252
1292
  tags: {
1253
1293
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1254
1294
  };
1295
+ presetRef?: {
1296
+ docId: string;
1297
+ versionId: string;
1298
+ } | undefined;
1255
1299
  docId: string;
1256
1300
  versionId: string;
1257
1301
  originalVersionId: string;
@@ -1367,6 +1411,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1367
1411
  tags: {
1368
1412
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1369
1413
  };
1414
+ presetRef?: {
1415
+ docId: string;
1416
+ versionId: string;
1417
+ } | undefined;
1370
1418
  docId: string;
1371
1419
  versionId: string;
1372
1420
  originalVersionId: string;
@@ -4,7 +4,7 @@ import type { EditableProjectSettings } from '@comapeo/core/dist/mapeo-project.j
4
4
  import type { BlobId } from '@comapeo/core/dist/types.js' with { 'resolution-mode': 'import' };
5
5
  import type { MapeoClientApi, MapeoProjectApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
6
6
  import type { ProjectSettings } from '@comapeo/schema' with { 'resolution-mode': 'import' };
7
- import { type QueryClient } from '@tanstack/react-query';
7
+ import { type QueryClient, type UseSuspenseQueryOptions } from '@tanstack/react-query';
8
8
  export declare function getProjectsQueryKey(): readonly ["@comapeo/core-react", "projects"];
9
9
  export declare function getProjectByIdQueryKey({ projectId }: {
10
10
  projectId: string;
@@ -45,105 +45,18 @@ export declare function getAttachmentUrlQueryKey({ projectId, blobId, }: {
45
45
  }): readonly ["@comapeo/core-react", "projects", string, "attachments", BlobId];
46
46
  export declare function projectsQueryOptions({ clientApi, }: {
47
47
  clientApi: MapeoClientApi;
48
- }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<(Pick<{
49
- schemaName: "projectSettings";
50
- name?: string | undefined;
51
- defaultPresets?: {
52
- point: string[];
53
- area: string[];
54
- vertex: string[];
55
- line: string[];
56
- relation: string[];
57
- } | undefined;
58
- configMetadata?: {
59
- name: string;
60
- buildDate: string;
61
- importDate: string;
62
- fileVersion: string;
63
- } | undefined;
64
- }, "name"> & {
65
- projectId: string;
66
- createdAt?: string | undefined;
67
- updatedAt?: string | undefined;
68
- })[], Error, (Pick<{
69
- schemaName: "projectSettings";
70
- name?: string | undefined;
71
- defaultPresets?: {
72
- point: string[];
73
- area: string[];
74
- vertex: string[];
75
- line: string[];
76
- relation: string[];
77
- } | undefined;
78
- configMetadata?: {
79
- name: string;
80
- buildDate: string;
81
- importDate: string;
82
- fileVersion: string;
83
- } | undefined;
84
- }, "name"> & {
85
- projectId: string;
86
- createdAt?: string | undefined;
87
- updatedAt?: string | undefined;
88
- })[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
89
- queryFn?: import("@tanstack/react-query").QueryFunction<(Pick<{
90
- schemaName: "projectSettings";
91
- name?: string | undefined;
92
- defaultPresets?: {
93
- point: string[];
94
- area: string[];
95
- vertex: string[];
96
- line: string[];
97
- relation: string[];
98
- } | undefined;
99
- configMetadata?: {
100
- name: string;
101
- buildDate: string;
102
- importDate: string;
103
- fileVersion: string;
104
- } | undefined;
105
- }, "name"> & {
106
- projectId: string;
107
- createdAt?: string | undefined;
108
- updatedAt?: string | undefined;
109
- })[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
48
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@comapeo/core/dist/mapeo-manager.js", { with: { "resolution-mode": "import" } }).ListedProject[], Error, import("@comapeo/core/dist/mapeo-manager.js", { with: { "resolution-mode": "import" } }).ListedProject[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
49
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@comapeo/core/dist/mapeo-manager.js", { with: { "resolution-mode": "import" } }).ListedProject[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
110
50
  } & {
111
51
  queryKey: readonly ["@comapeo/core-react", "projects"] & {
112
- [dataTagSymbol]: (Pick<{
113
- schemaName: "projectSettings";
114
- name?: string | undefined;
115
- defaultPresets?: {
116
- point: string[];
117
- area: string[];
118
- vertex: string[];
119
- line: string[];
120
- relation: string[];
121
- } | undefined;
122
- configMetadata?: {
123
- name: string;
124
- buildDate: string;
125
- importDate: string;
126
- fileVersion: string;
127
- } | undefined;
128
- }, "name"> & {
129
- projectId: string;
130
- createdAt?: string | undefined;
131
- updatedAt?: string | undefined;
132
- })[];
52
+ [dataTagSymbol]: import("@comapeo/core/dist/mapeo-manager.js", { with: { "resolution-mode": "import" } }).ListedProject[];
133
53
  [dataTagErrorSymbol]: Error;
134
54
  };
135
55
  };
136
56
  export declare function projectByIdQueryOptions({ clientApi, projectId, }: {
137
57
  clientApi: MapeoClientApi;
138
58
  projectId: string;
139
- }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>, Error, import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>, readonly ["@comapeo/core-react", "projects", string]>, "queryFn"> & {
140
- queryFn?: import("@tanstack/react-query").QueryFunction<import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>, readonly ["@comapeo/core-react", "projects", string], never> | undefined;
141
- } & {
142
- queryKey: readonly ["@comapeo/core-react", "projects", string] & {
143
- [dataTagSymbol]: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>;
144
- [dataTagErrorSymbol]: Error;
145
- };
146
- };
59
+ }): UseSuspenseQueryOptions<MapeoProjectApi, Error, MapeoProjectApi, ReturnType<typeof getProjectByIdQueryKey>>;
147
60
  export declare function projectSettingsQueryOptions({ projectApi, projectId, }: {
148
61
  projectApi: MapeoProjectApi;
149
62
  projectId: string;
@@ -1,6 +1,6 @@
1
1
  import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
2
- import { type JSX, type ReactNode } from 'react';
3
- export declare const ClientApiContext: import("react").Context<import("@comapeo/ipc/dist/client.js").MapeoClientApi | null>;
2
+ import { type Context, type JSX, type ReactNode } from 'react';
3
+ export declare const ClientApiContext: Context<MapeoClientApi | null>;
4
4
  /**
5
5
  * Create a context provider that holds a CoMapeo API client instance.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { createContext, createElement } from 'react';
1
+ import { createContext, createElement, } from 'react';
2
2
  export const ClientApiContext = createContext(null);
3
3
  /**
4
4
  * Create a context provider that holds a CoMapeo API client instance.
@@ -1,3 +1,4 @@
1
+ import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
1
2
  /**
2
3
  * Access a client API instance. If a ClientApiContext provider is not
3
4
  * set up, it will throw an error.
@@ -23,7 +24,7 @@
23
24
  * ```
24
25
  *
25
26
  */
26
- export declare function useClientApi(): import("@comapeo/ipc/dist/client.js").MapeoClientApi;
27
+ export declare function useClientApi(): MapeoClientApi;
27
28
  /**
28
29
  * Retrieve info about the current device.
29
30
  *
@@ -37,7 +38,7 @@ export declare function useClientApi(): import("@comapeo/ipc/dist/client.js").Ma
37
38
  export declare function useOwnDeviceInfo(): {
38
39
  data: {
39
40
  deviceId: string;
40
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
41
+ deviceType: import("@comapeo/core/dist/schema/client.js").DeviceInfoParam["deviceType"];
41
42
  } & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>;
42
43
  error: Error | null;
43
44
  isRefetching: boolean;
@@ -1,5 +1,6 @@
1
1
  import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api.js' with { 'resolution-mode': 'import' };
2
2
  import type { BlobId } from '@comapeo/core/dist/types.js' with { 'resolution-mode': 'import' };
3
+ import type { MapeoProjectApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
3
4
  import { type SyncState } from '../lib/sync.js';
4
5
  /**
5
6
  * Retrieve the project settings for a project.
@@ -39,7 +40,7 @@ export declare function useProjectSettings({ projectId }: {
39
40
  export declare function useSingleProject({ projectId }: {
40
41
  projectId: string;
41
42
  }): {
42
- data: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>;
43
+ data: MapeoProjectApi;
43
44
  error: Error | null;
44
45
  isRefetching: boolean;
45
46
  };
@@ -56,27 +57,7 @@ export declare function useSingleProject({ projectId }: {
56
57
  * ```
57
58
  */
58
59
  export declare function useManyProjects(): {
59
- data: (Pick<{
60
- schemaName: "projectSettings";
61
- name?: string | undefined;
62
- defaultPresets?: {
63
- point: string[];
64
- area: string[];
65
- vertex: string[];
66
- line: string[];
67
- relation: string[];
68
- } | undefined;
69
- configMetadata?: {
70
- name: string;
71
- buildDate: string;
72
- importDate: string;
73
- fileVersion: string;
74
- } | undefined;
75
- }, "name"> & {
76
- projectId: string;
77
- createdAt?: string | undefined;
78
- updatedAt?: string | undefined;
79
- })[];
60
+ data: import("@comapeo/core/dist/mapeo-manager.js").ListedProject[];
80
61
  error: Error | null;
81
62
  isRefetching: boolean;
82
63
  };
@@ -8,20 +8,20 @@ export declare function deviceInfoQueryOptions({ clientApi, }: {
8
8
  clientApi: MapeoClientApi;
9
9
  }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
10
10
  deviceId: string;
11
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
11
+ deviceType: import("@comapeo/core/dist/schema/client.js").DeviceInfoParam["deviceType"];
12
12
  } & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, Error, {
13
13
  deviceId: string;
14
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
14
+ deviceType: import("@comapeo/core/dist/schema/client.js").DeviceInfoParam["deviceType"];
15
15
  } & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"]>, "queryFn"> & {
16
16
  queryFn?: import("@tanstack/react-query").QueryFunction<{
17
17
  deviceId: string;
18
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
18
+ deviceType: import("@comapeo/core/dist/schema/client.js").DeviceInfoParam["deviceType"];
19
19
  } & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"], never> | undefined;
20
20
  } & {
21
21
  queryKey: readonly ["@comapeo/core-react", "client", "device_info"] & {
22
22
  [dataTagSymbol]: {
23
23
  deviceId: string;
24
- deviceType: "UNRECOGNIZED" | "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer";
24
+ deviceType: import("@comapeo/core/dist/schema/client.js").DeviceInfoParam["deviceType"];
25
25
  } & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>;
26
26
  [dataTagErrorSymbol]: Error;
27
27
  };
@@ -46,6 +46,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
46
46
  tags: {
47
47
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
48
48
  };
49
+ presetRef?: {
50
+ docId: string;
51
+ versionId: string;
52
+ } | undefined;
49
53
  docId: string;
50
54
  versionId: string;
51
55
  originalVersionId: string;
@@ -164,6 +168,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
164
168
  tags: {
165
169
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
166
170
  };
171
+ presetRef?: {
172
+ docId: string;
173
+ versionId: string;
174
+ } | undefined;
167
175
  docId: string;
168
176
  versionId: string;
169
177
  originalVersionId: string;
@@ -286,6 +294,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
286
294
  tags: {
287
295
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
288
296
  };
297
+ presetRef?: {
298
+ docId: string;
299
+ versionId: string;
300
+ } | undefined;
289
301
  docId: string;
290
302
  versionId: string;
291
303
  originalVersionId: string;
@@ -413,6 +425,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
413
425
  tags: {
414
426
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
415
427
  };
428
+ presetRef?: {
429
+ docId: string;
430
+ versionId: string;
431
+ } | undefined;
416
432
  docId: string;
417
433
  versionId: string;
418
434
  originalVersionId: string;
@@ -541,6 +557,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
541
557
  tags: {
542
558
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
543
559
  };
560
+ presetRef?: {
561
+ docId: string;
562
+ versionId: string;
563
+ } | undefined;
544
564
  docId: string;
545
565
  versionId: string;
546
566
  originalVersionId: string;
@@ -659,6 +679,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
659
679
  tags: {
660
680
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
661
681
  };
682
+ presetRef?: {
683
+ docId: string;
684
+ versionId: string;
685
+ } | undefined;
662
686
  docId: string;
663
687
  versionId: string;
664
688
  originalVersionId: string;
@@ -780,6 +804,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
780
804
  tags: {
781
805
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
782
806
  };
807
+ presetRef?: {
808
+ docId: string;
809
+ versionId: string;
810
+ } | undefined;
783
811
  docId: string;
784
812
  versionId: string;
785
813
  originalVersionId: string;
@@ -905,6 +933,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
905
933
  tags: {
906
934
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
907
935
  };
936
+ presetRef?: {
937
+ docId: string;
938
+ versionId: string;
939
+ } | undefined;
908
940
  docId: string;
909
941
  versionId: string;
910
942
  originalVersionId: string;
@@ -1033,6 +1065,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1033
1065
  tags: {
1034
1066
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1035
1067
  };
1068
+ presetRef?: {
1069
+ docId: string;
1070
+ versionId: string;
1071
+ } | undefined;
1036
1072
  docId: string;
1037
1073
  versionId: string;
1038
1074
  originalVersionId: string;
@@ -1141,6 +1177,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1141
1177
  tags: {
1142
1178
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1143
1179
  };
1180
+ presetRef?: {
1181
+ docId: string;
1182
+ versionId: string;
1183
+ } | undefined;
1144
1184
  docId: string;
1145
1185
  versionId: string;
1146
1186
  originalVersionId: string;
@@ -1252,6 +1292,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1252
1292
  tags: {
1253
1293
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1254
1294
  };
1295
+ presetRef?: {
1296
+ docId: string;
1297
+ versionId: string;
1298
+ } | undefined;
1255
1299
  docId: string;
1256
1300
  versionId: string;
1257
1301
  originalVersionId: string;
@@ -1367,6 +1411,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
1367
1411
  tags: {
1368
1412
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1369
1413
  };
1414
+ presetRef?: {
1415
+ docId: string;
1416
+ versionId: string;
1417
+ } | undefined;
1370
1418
  docId: string;
1371
1419
  versionId: string;
1372
1420
  originalVersionId: string;
@@ -4,7 +4,7 @@ import type { EditableProjectSettings } from '@comapeo/core/dist/mapeo-project.j
4
4
  import type { BlobId } from '@comapeo/core/dist/types.js' with { 'resolution-mode': 'import' };
5
5
  import type { MapeoClientApi, MapeoProjectApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
6
6
  import type { ProjectSettings } from '@comapeo/schema' with { 'resolution-mode': 'import' };
7
- import { type QueryClient } from '@tanstack/react-query';
7
+ import { type QueryClient, type UseSuspenseQueryOptions } from '@tanstack/react-query';
8
8
  export declare function getProjectsQueryKey(): readonly ["@comapeo/core-react", "projects"];
9
9
  export declare function getProjectByIdQueryKey({ projectId }: {
10
10
  projectId: string;
@@ -45,105 +45,18 @@ export declare function getAttachmentUrlQueryKey({ projectId, blobId, }: {
45
45
  }): readonly ["@comapeo/core-react", "projects", string, "attachments", BlobId];
46
46
  export declare function projectsQueryOptions({ clientApi, }: {
47
47
  clientApi: MapeoClientApi;
48
- }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<(Pick<{
49
- schemaName: "projectSettings";
50
- name?: string | undefined;
51
- defaultPresets?: {
52
- point: string[];
53
- area: string[];
54
- vertex: string[];
55
- line: string[];
56
- relation: string[];
57
- } | undefined;
58
- configMetadata?: {
59
- name: string;
60
- buildDate: string;
61
- importDate: string;
62
- fileVersion: string;
63
- } | undefined;
64
- }, "name"> & {
65
- projectId: string;
66
- createdAt?: string | undefined;
67
- updatedAt?: string | undefined;
68
- })[], Error, (Pick<{
69
- schemaName: "projectSettings";
70
- name?: string | undefined;
71
- defaultPresets?: {
72
- point: string[];
73
- area: string[];
74
- vertex: string[];
75
- line: string[];
76
- relation: string[];
77
- } | undefined;
78
- configMetadata?: {
79
- name: string;
80
- buildDate: string;
81
- importDate: string;
82
- fileVersion: string;
83
- } | undefined;
84
- }, "name"> & {
85
- projectId: string;
86
- createdAt?: string | undefined;
87
- updatedAt?: string | undefined;
88
- })[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
89
- queryFn?: import("@tanstack/react-query").QueryFunction<(Pick<{
90
- schemaName: "projectSettings";
91
- name?: string | undefined;
92
- defaultPresets?: {
93
- point: string[];
94
- area: string[];
95
- vertex: string[];
96
- line: string[];
97
- relation: string[];
98
- } | undefined;
99
- configMetadata?: {
100
- name: string;
101
- buildDate: string;
102
- importDate: string;
103
- fileVersion: string;
104
- } | undefined;
105
- }, "name"> & {
106
- projectId: string;
107
- createdAt?: string | undefined;
108
- updatedAt?: string | undefined;
109
- })[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
48
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], Error, import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
49
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
110
50
  } & {
111
51
  queryKey: readonly ["@comapeo/core-react", "projects"] & {
112
- [dataTagSymbol]: (Pick<{
113
- schemaName: "projectSettings";
114
- name?: string | undefined;
115
- defaultPresets?: {
116
- point: string[];
117
- area: string[];
118
- vertex: string[];
119
- line: string[];
120
- relation: string[];
121
- } | undefined;
122
- configMetadata?: {
123
- name: string;
124
- buildDate: string;
125
- importDate: string;
126
- fileVersion: string;
127
- } | undefined;
128
- }, "name"> & {
129
- projectId: string;
130
- createdAt?: string | undefined;
131
- updatedAt?: string | undefined;
132
- })[];
52
+ [dataTagSymbol]: import("@comapeo/core/dist/mapeo-manager.js").ListedProject[];
133
53
  [dataTagErrorSymbol]: Error;
134
54
  };
135
55
  };
136
56
  export declare function projectByIdQueryOptions({ clientApi, projectId, }: {
137
57
  clientApi: MapeoClientApi;
138
58
  projectId: string;
139
- }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>, Error, import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>, readonly ["@comapeo/core-react", "projects", string]>, "queryFn"> & {
140
- queryFn?: import("@tanstack/react-query").QueryFunction<import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>, readonly ["@comapeo/core-react", "projects", string], never> | undefined;
141
- } & {
142
- queryKey: readonly ["@comapeo/core-react", "projects", string] & {
143
- [dataTagSymbol]: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>;
144
- [dataTagErrorSymbol]: Error;
145
- };
146
- };
59
+ }): UseSuspenseQueryOptions<MapeoProjectApi, Error, MapeoProjectApi, ReturnType<typeof getProjectByIdQueryKey>>;
147
60
  export declare function projectSettingsQueryOptions({ projectApi, projectId, }: {
148
61
  projectApi: MapeoProjectApi;
149
62
  projectId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comapeo/core-react",
3
- "version": "4.3.0",
3
+ "version": "6.0.0-prerelease.1",
4
4
  "description": "React wrapper for working with @comapeo/core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,44 +57,44 @@
57
57
  "types": "tsc"
58
58
  },
59
59
  "peerDependencies": {
60
- "@comapeo/core": "^3.2.0",
61
- "@comapeo/ipc": "^3.0.0",
60
+ "@comapeo/core": "^4.0.0",
61
+ "@comapeo/ipc": "^5.0.0-prerelease.1",
62
62
  "@comapeo/schema": "*",
63
63
  "@tanstack/react-query": "^5",
64
64
  "react": "^18 || ^19"
65
65
  },
66
66
  "devDependencies": {
67
- "@comapeo/core": "3.2.0",
68
- "@comapeo/ipc": "3.0.0",
69
- "@comapeo/schema": "1.6.0",
70
- "@eslint/compat": "1.2.9",
71
- "@eslint/js": "9.27.0",
72
- "@ianvs/prettier-plugin-sort-imports": "4.4.1",
67
+ "@comapeo/core": "4.0.0",
68
+ "@comapeo/ipc": "^5.0.0-prerelease.1",
69
+ "@comapeo/schema": "2.0.0",
70
+ "@eslint/compat": "1.3.0",
71
+ "@eslint/js": "9.29.0",
72
+ "@ianvs/prettier-plugin-sort-imports": "4.4.2",
73
73
  "@mapeo/crypto": "1.0.0-alpha.10",
74
- "@tanstack/eslint-plugin-query": "5.74.7",
75
- "@tanstack/react-query": "5.76.1",
74
+ "@tanstack/eslint-plugin-query": "5.78.0",
75
+ "@tanstack/react-query": "5.80.7",
76
76
  "@testing-library/dom": "10.4.0",
77
77
  "@testing-library/react": "16.3.0",
78
78
  "@types/node": "22.15.19",
79
- "@types/react": "19.0.12",
80
- "@types/react-dom": "19.0.4",
81
- "@vitest/eslint-plugin": "1.2.0",
82
- "eslint": "9.27.0",
79
+ "@types/react": "19.1.8",
80
+ "@types/react-dom": "19.1.6",
81
+ "@vitest/eslint-plugin": "1.2.7",
82
+ "eslint": "9.29.0",
83
83
  "eslint-plugin-react-hooks": "5.2.0",
84
- "eslint-plugin-testing-library": "7.2.1",
84
+ "eslint-plugin-testing-library": "7.5.3",
85
85
  "fastify": "4.29.1",
86
- "globals": "16.1.0",
86
+ "globals": "16.2.0",
87
87
  "husky": "9.1.7",
88
88
  "lint-staged": "15.5.1",
89
89
  "npm-run-all2": "7.0.2",
90
90
  "prettier": "3.5.3",
91
91
  "random-access-memory": "6.2.1",
92
- "react": "19.0.0",
93
- "react-dom": "19.0.0",
92
+ "react": "19.1.0",
93
+ "react-dom": "19.1.0",
94
94
  "tsdoc-markdown": "1.2.0",
95
95
  "tshy": "3.0.2",
96
96
  "typescript": "5.8.3",
97
- "typescript-eslint": "8.32.1",
98
- "vitest": "3.1.4"
97
+ "typescript-eslint": "8.34.1",
98
+ "vitest": "3.2.3"
99
99
  }
100
100
  }