@comapeo/core-react 1.0.1 → 1.1.0
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 +14 -0
- package/dist/commonjs/contexts/ClientApi.js +16 -0
- package/dist/commonjs/hooks/client.d.ts +59 -0
- package/dist/commonjs/hooks/client.js +71 -0
- package/dist/{hooks → commonjs/hooks}/documents.d.ts +2 -2
- package/dist/commonjs/hooks/documents.js +138 -0
- package/dist/commonjs/hooks/maps.js +37 -0
- package/dist/commonjs/hooks/projects.d.ts +251 -0
- package/dist/commonjs/hooks/projects.js +258 -0
- package/dist/commonjs/index.d.ts +11 -0
- package/dist/commonjs/index.js +69 -0
- package/dist/commonjs/lib/react-query/client.d.ts +30 -0
- package/dist/commonjs/lib/react-query/client.js +36 -0
- package/dist/{lib → commonjs/lib}/react-query/documents.d.ts +101 -101
- package/dist/commonjs/lib/react-query/documents.js +92 -0
- package/dist/commonjs/lib/react-query/invites.d.ts +12 -0
- package/dist/commonjs/lib/react-query/invites.js +22 -0
- package/dist/commonjs/lib/react-query/maps.d.ts +15 -0
- package/dist/commonjs/lib/react-query/maps.js +23 -0
- package/dist/commonjs/lib/react-query/projects.d.ts +196 -0
- package/dist/commonjs/lib/react-query/projects.js +147 -0
- package/dist/commonjs/lib/react-query/shared.js +16 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/{contexts → esm/contexts}/ClientApi.d.ts +3 -3
- package/dist/{hooks → esm/hooks}/client.d.ts +2 -2
- package/dist/{hooks → esm/hooks}/client.js +2 -2
- package/dist/esm/hooks/documents.d.ts +112 -0
- package/dist/{hooks → esm/hooks}/documents.js +2 -2
- package/dist/esm/hooks/maps.d.ts +33 -0
- package/dist/{hooks → esm/hooks}/maps.js +2 -2
- package/dist/{hooks → esm/hooks}/projects.d.ts +6 -6
- package/dist/{hooks → esm/hooks}/projects.js +2 -2
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/lib/react-query/client.d.ts +30 -0
- package/dist/{lib → esm/lib}/react-query/client.js +1 -1
- package/dist/esm/lib/react-query/documents.d.ts +1501 -0
- package/dist/{lib → esm/lib}/react-query/documents.js +1 -1
- package/dist/esm/lib/react-query/invites.d.ts +12 -0
- package/dist/{lib → esm/lib}/react-query/invites.js +1 -1
- package/dist/esm/lib/react-query/maps.d.ts +15 -0
- package/dist/{lib → esm/lib}/react-query/maps.js +1 -1
- package/dist/esm/lib/react-query/projects.d.ts +196 -0
- package/dist/{lib → esm/lib}/react-query/projects.js +1 -1
- package/dist/esm/lib/react-query/shared.d.ts +5 -0
- package/dist/esm/package.json +3 -0
- package/package.json +27 -12
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -11
- package/dist/lib/react-query/client.d.ts +0 -30
- package/dist/lib/react-query/invites.d.ts +0 -12
- package/dist/lib/react-query/maps.d.ts +0 -15
- package/dist/lib/react-query/projects.d.ts +0 -196
- /package/dist/{hooks → commonjs/hooks}/maps.d.ts +0 -0
- /package/dist/{lib → commonjs/lib}/react-query/shared.d.ts +0 -0
- /package/dist/{contexts → esm/contexts}/ClientApi.js +0 -0
- /package/dist/{lib → esm/lib}/react-query/shared.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api';
|
|
2
|
-
import type { BlobId } from '@comapeo/core/dist/types';
|
|
1
|
+
import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api.js' with { 'resolution-mode': 'import' };
|
|
2
|
+
import type { BlobId } from '@comapeo/core/dist/types.js' with { 'resolution-mode': 'import' };
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the project settings for a project.
|
|
5
5
|
*
|
|
@@ -17,7 +17,7 @@ import type { BlobId } from '@comapeo/core/dist/types';
|
|
|
17
17
|
export declare function useProjectSettings({ projectId }: {
|
|
18
18
|
projectId: string;
|
|
19
19
|
}): {
|
|
20
|
-
data: import("@comapeo/core/dist/mapeo-project").EditableProjectSettings;
|
|
20
|
+
data: import("@comapeo/core/dist/mapeo-project.js").EditableProjectSettings;
|
|
21
21
|
error: Error | null;
|
|
22
22
|
isRefetching: boolean;
|
|
23
23
|
};
|
|
@@ -38,7 +38,7 @@ export declare function useProjectSettings({ projectId }: {
|
|
|
38
38
|
export declare function useSingleProject({ projectId }: {
|
|
39
39
|
projectId: string;
|
|
40
40
|
}): {
|
|
41
|
-
data: import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>;
|
|
41
|
+
data: import("rpc-reflector/lib/types.js").ClientApi<import("@comapeo/core/dist/mapeo-project.js").MapeoProject>;
|
|
42
42
|
error: Error | null;
|
|
43
43
|
isRefetching: boolean;
|
|
44
44
|
};
|
|
@@ -98,7 +98,7 @@ export declare function useSingleMember({ projectId, deviceId, }: {
|
|
|
98
98
|
projectId: string;
|
|
99
99
|
deviceId: string;
|
|
100
100
|
}): {
|
|
101
|
-
data: import("@comapeo/core/dist/member-api").MemberInfo;
|
|
101
|
+
data: import("@comapeo/core/dist/member-api.js").MemberInfo;
|
|
102
102
|
error: Error | null;
|
|
103
103
|
isRefetching: boolean;
|
|
104
104
|
};
|
|
@@ -119,7 +119,7 @@ export declare function useSingleMember({ projectId, deviceId, }: {
|
|
|
119
119
|
export declare function useManyMembers({ projectId }: {
|
|
120
120
|
projectId: string;
|
|
121
121
|
}): {
|
|
122
|
-
data: import("@comapeo/core/dist/member-api").MemberInfo[];
|
|
122
|
+
data: import("@comapeo/core/dist/member-api.js").MemberInfo[];
|
|
123
123
|
error: Error | null;
|
|
124
124
|
isRefetching: boolean;
|
|
125
125
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
2
|
-
import { attachmentUrlQueryOptions, documentCreatedByQueryOptions, iconUrlQueryOptions, projectByIdQueryOptions, projectMemberByIdQueryOptions, projectMembersQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, } from '../lib/react-query/projects';
|
|
3
|
-
import { useClientApi } from './client';
|
|
2
|
+
import { attachmentUrlQueryOptions, documentCreatedByQueryOptions, iconUrlQueryOptions, projectByIdQueryOptions, projectMemberByIdQueryOptions, projectMembersQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, } from '../lib/react-query/projects.js';
|
|
3
|
+
import { useClientApi } from './client.js';
|
|
4
4
|
/**
|
|
5
5
|
* Retrieve the project settings for a project.
|
|
6
6
|
*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ClientApiContext, ClientApiProvider } from './contexts/ClientApi.js';
|
|
2
|
+
export { useClientApi, useIsArchiveDevice, useOwnDeviceInfo, } from './hooks/client.js';
|
|
3
|
+
export { useManyDocs, useSingleDocByDocId, useSingleDocByVersionId, } from './hooks/documents.js';
|
|
4
|
+
export { useMapStyleUrl } from './hooks/maps.js';
|
|
5
|
+
export { useAttachmentUrl, useDocumentCreatedBy, useIconUrl, useManyMembers, useManyProjects, useProjectSettings, useSingleMember, useSingleProject, } from './hooks/projects.js';
|
|
6
|
+
export { deviceInfoQueryOptions, getClientQueryKey, getDeviceInfoQueryKey, getIsArchiveDeviceQueryKey, isArchiveDeviceQueryOptions, } from './lib/react-query/client.js';
|
|
7
|
+
export { documentByDocumentIdQueryOptions, documentByVersionIdQueryOptions, documentsQueryOptions, getDocumentByDocIdQueryKey, getDocumentByVersionIdQueryKey, getDocumentsQueryKey, getManyDocumentsQueryKey, type DocumentType, } from './lib/react-query/documents.js';
|
|
8
|
+
export { getInvitesQueryKey, getPendingInvitesQueryKey, pendingInvitesQueryOptions, } from './lib/react-query/invites.js';
|
|
9
|
+
export { getMapsQueryKey, getStyleJsonUrlQueryKey, mapStyleJsonUrlQueryOptions, } from './lib/react-query/maps.js';
|
|
10
|
+
export { attachmentUrlQueryOptions, documentCreatedByQueryOptions, getAttachmentUrlQueryKey, getDocumentCreatedByQueryKey, getIconUrlQueryKey, getMemberByIdQueryKey, getMembersQueryKey, getProjectByIdQueryKey, getProjectRoleQueryKey, getProjectSettingsQueryKey, getProjectsQueryKey, iconUrlQueryOptions, projectByIdQueryOptions, projectMembersQueryOptions, projectOwnRoleQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, } from './lib/react-query/projects.js';
|
|
11
|
+
export { ROOT_QUERY_KEY, baseQueryOptions } from './lib/react-query/shared.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ClientApiContext, ClientApiProvider } from './contexts/ClientApi.js';
|
|
2
|
+
export { useClientApi, useIsArchiveDevice, useOwnDeviceInfo, } from './hooks/client.js';
|
|
3
|
+
export { useManyDocs, useSingleDocByDocId, useSingleDocByVersionId, } from './hooks/documents.js';
|
|
4
|
+
export { useMapStyleUrl } from './hooks/maps.js';
|
|
5
|
+
export { useAttachmentUrl, useDocumentCreatedBy, useIconUrl, useManyMembers, useManyProjects, useProjectSettings, useSingleMember, useSingleProject, } from './hooks/projects.js';
|
|
6
|
+
export { deviceInfoQueryOptions, getClientQueryKey, getDeviceInfoQueryKey, getIsArchiveDeviceQueryKey, isArchiveDeviceQueryOptions, } from './lib/react-query/client.js';
|
|
7
|
+
export { documentByDocumentIdQueryOptions, documentByVersionIdQueryOptions, documentsQueryOptions, getDocumentByDocIdQueryKey, getDocumentByVersionIdQueryKey, getDocumentsQueryKey, getManyDocumentsQueryKey, } from './lib/react-query/documents.js';
|
|
8
|
+
export { getInvitesQueryKey, getPendingInvitesQueryKey, pendingInvitesQueryOptions, } from './lib/react-query/invites.js';
|
|
9
|
+
export { getMapsQueryKey, getStyleJsonUrlQueryKey, mapStyleJsonUrlQueryOptions, } from './lib/react-query/maps.js';
|
|
10
|
+
export { attachmentUrlQueryOptions, documentCreatedByQueryOptions, getAttachmentUrlQueryKey, getDocumentCreatedByQueryKey, getIconUrlQueryKey, getMemberByIdQueryKey, getMembersQueryKey, getProjectByIdQueryKey, getProjectRoleQueryKey, getProjectSettingsQueryKey, getProjectsQueryKey, iconUrlQueryOptions, projectByIdQueryOptions, projectMembersQueryOptions, projectOwnRoleQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, } from './lib/react-query/projects.js';
|
|
11
|
+
export { ROOT_QUERY_KEY, baseQueryOptions } from './lib/react-query/shared.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
|
|
2
|
+
export declare function getClientQueryKey(): readonly ["@comapeo/core-react", "client"];
|
|
3
|
+
export declare function getDeviceInfoQueryKey(): readonly ["@comapeo/core-react", "client", "device_info"];
|
|
4
|
+
export declare function getIsArchiveDeviceQueryKey(): readonly ["@comapeo/core-react", "client", "is_archive_device"];
|
|
5
|
+
export declare function deviceInfoQueryOptions({ clientApi, }: {
|
|
6
|
+
clientApi: MapeoClientApi;
|
|
7
|
+
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
8
|
+
deviceId: string;
|
|
9
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
10
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, Error, {
|
|
11
|
+
deviceId: string;
|
|
12
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
13
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, import("@tanstack/react-query").QueryKey>, "queryFn"> & {
|
|
14
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
15
|
+
deviceId: string;
|
|
16
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
17
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>, import("@tanstack/react-query").QueryKey, never> | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, {
|
|
20
|
+
deviceId: string;
|
|
21
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
22
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js").DeviceInfoParam>>;
|
|
23
|
+
};
|
|
24
|
+
export declare function isArchiveDeviceQueryOptions({ clientApi, }: {
|
|
25
|
+
clientApi: MapeoClientApi;
|
|
26
|
+
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<boolean, Error, boolean, import("@tanstack/react-query").QueryKey>, "queryFn"> & {
|
|
27
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<boolean, import("@tanstack/react-query").QueryKey, never> | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, boolean>;
|
|
30
|
+
};
|