@comapeo/core-react 5.0.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.
- package/dist/commonjs/contexts/ClientApi.d.ts +2 -4
- package/dist/commonjs/hooks/client.d.ts +2 -3
- package/dist/commonjs/hooks/projects.d.ts +2 -1
- package/dist/commonjs/lib/react-query/projects.d.ts +2 -9
- package/dist/esm/contexts/ClientApi.d.ts +2 -4
- package/dist/esm/contexts/ClientApi.js +1 -1
- package/dist/esm/hooks/client.d.ts +2 -3
- package/dist/esm/hooks/projects.d.ts +2 -1
- package/dist/esm/lib/react-query/projects.d.ts +2 -9
- package/package.json +3 -3
|
@@ -1,8 +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:
|
|
4
|
-
getProject: (projectPublicId: string) => Promise<import("@comapeo/ipc/dist/client.js", { with: { "resolution-mode": "import" } }).MapeoProjectApi>;
|
|
5
|
-
}> | null>;
|
|
2
|
+
import { type Context, type JSX, type ReactNode } from 'react';
|
|
3
|
+
export declare const ClientApiContext: Context<MapeoClientApi | null>;
|
|
6
4
|
/**
|
|
7
5
|
* Create a context provider that holds a CoMapeo API client instance.
|
|
8
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,9 +24,7 @@
|
|
|
23
24
|
* ```
|
|
24
25
|
*
|
|
25
26
|
*/
|
|
26
|
-
export declare function useClientApi():
|
|
27
|
-
getProject: (projectPublicId: string) => Promise<import("@comapeo/ipc/dist/client.js", { with: { "resolution-mode": "import" } }).MapeoProjectApi>;
|
|
28
|
-
}>;
|
|
27
|
+
export declare function useClientApi(): MapeoClientApi;
|
|
29
28
|
/**
|
|
30
29
|
* Retrieve info about the current device.
|
|
31
30
|
*
|
|
@@ -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:
|
|
43
|
+
data: MapeoProjectApi;
|
|
43
44
|
error: Error | null;
|
|
44
45
|
isRefetching: boolean;
|
|
45
46
|
};
|
|
@@ -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;
|
|
@@ -56,14 +56,7 @@ export declare function projectsQueryOptions({ clientApi, }: {
|
|
|
56
56
|
export declare function projectByIdQueryOptions({ clientApi, projectId, }: {
|
|
57
57
|
clientApi: MapeoClientApi;
|
|
58
58
|
projectId: string;
|
|
59
|
-
}):
|
|
60
|
-
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;
|
|
61
|
-
} & {
|
|
62
|
-
queryKey: readonly ["@comapeo/core-react", "projects", string] & {
|
|
63
|
-
[dataTagSymbol]: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js", { with: { "resolution-mode": "import" } }).MapeoProject>;
|
|
64
|
-
[dataTagErrorSymbol]: Error;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
59
|
+
}): UseSuspenseQueryOptions<MapeoProjectApi, Error, MapeoProjectApi, ReturnType<typeof getProjectByIdQueryKey>>;
|
|
67
60
|
export declare function projectSettingsQueryOptions({ projectApi, projectId, }: {
|
|
68
61
|
projectApi: MapeoProjectApi;
|
|
69
62
|
projectId: string;
|
|
@@ -1,8 +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:
|
|
4
|
-
getProject: (projectPublicId: string) => Promise<import("@comapeo/ipc/dist/client.js").MapeoProjectApi>;
|
|
5
|
-
}> | null>;
|
|
2
|
+
import { type Context, type JSX, type ReactNode } from 'react';
|
|
3
|
+
export declare const ClientApiContext: Context<MapeoClientApi | null>;
|
|
6
4
|
/**
|
|
7
5
|
* Create a context provider that holds a CoMapeo API client instance.
|
|
8
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,9 +24,7 @@
|
|
|
23
24
|
* ```
|
|
24
25
|
*
|
|
25
26
|
*/
|
|
26
|
-
export declare function useClientApi():
|
|
27
|
-
getProject: (projectPublicId: string) => Promise<import("@comapeo/ipc/dist/client.js").MapeoProjectApi>;
|
|
28
|
-
}>;
|
|
27
|
+
export declare function useClientApi(): MapeoClientApi;
|
|
29
28
|
/**
|
|
30
29
|
* Retrieve info about the current device.
|
|
31
30
|
*
|
|
@@ -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:
|
|
43
|
+
data: MapeoProjectApi;
|
|
43
44
|
error: Error | null;
|
|
44
45
|
isRefetching: boolean;
|
|
45
46
|
};
|
|
@@ -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;
|
|
@@ -56,14 +56,7 @@ export declare function projectsQueryOptions({ clientApi, }: {
|
|
|
56
56
|
export declare function projectByIdQueryOptions({ clientApi, projectId, }: {
|
|
57
57
|
clientApi: MapeoClientApi;
|
|
58
58
|
projectId: string;
|
|
59
|
-
}):
|
|
60
|
-
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;
|
|
61
|
-
} & {
|
|
62
|
-
queryKey: readonly ["@comapeo/core-react", "projects", string] & {
|
|
63
|
-
[dataTagSymbol]: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>;
|
|
64
|
-
[dataTagErrorSymbol]: Error;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
59
|
+
}): UseSuspenseQueryOptions<MapeoProjectApi, Error, MapeoProjectApi, ReturnType<typeof getProjectByIdQueryKey>>;
|
|
67
60
|
export declare function projectSettingsQueryOptions({ projectApi, projectId, }: {
|
|
68
61
|
projectApi: MapeoProjectApi;
|
|
69
62
|
projectId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comapeo/core-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-prerelease.1",
|
|
4
4
|
"description": "React wrapper for working with @comapeo/core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@comapeo/core": "^4.0.0",
|
|
61
|
-
"@comapeo/ipc": "^
|
|
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
67
|
"@comapeo/core": "4.0.0",
|
|
68
|
-
"@comapeo/ipc": "
|
|
68
|
+
"@comapeo/ipc": "^5.0.0-prerelease.1",
|
|
69
69
|
"@comapeo/schema": "2.0.0",
|
|
70
70
|
"@eslint/compat": "1.3.0",
|
|
71
71
|
"@eslint/js": "9.29.0",
|