@comapeo/core-react 0.1.1 → 1.0.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.
@@ -7,8 +7,7 @@ import { useClientApi } from './client';
7
7
  * If `opts.refreshToken` is specified, it will be appended to the returned URL as a search param. This is useful for forcing cache busting
8
8
  * due to hidden internal details by consuming components (e.g. map component from MapLibre).
9
9
  *
10
- * @param {Object} opts
11
- * @param {string} opts.refreshToken String to append to the returned value as a search param
10
+ * @param opts.refreshToken String to append to the returned value as a search param
12
11
  *
13
12
  * @example
14
13
  * ```tsx
@@ -1,10 +1,9 @@
1
+ import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api';
1
2
  import type { BlobId } from '@comapeo/core/dist/types';
2
- import { iconUrlQueryOptions } from '../lib/react-query/projects';
3
3
  /**
4
4
  * Retrieve the project settings for a project.
5
5
  *
6
- * @param {Object} opts
7
- * @param {string} opts.projectId Project public ID
6
+ * @param opts.projectId Project public ID
8
7
  *
9
8
  * @example
10
9
  * ```tsx
@@ -27,8 +26,7 @@ export declare function useProjectSettings({ projectId }: {
27
26
  *
28
27
  * This is mostly used internally by the other hooks and should only be used if certain project APIs are not exposed via the hooks.
29
28
  *
30
- * @param {Object} opts
31
- * @param {string} opts.projectId Project public ID
29
+ * @param opts.projectId Project public ID
32
30
  *
33
31
  * @example
34
32
  * ```tsx
@@ -84,9 +82,8 @@ export declare function useManyProjects(): {
84
82
  /**
85
83
  * Retrieve a single member of a project.
86
84
  *
87
- * @param {Object} opts
88
- * @param {string} opts.projectId Project public ID
89
- * @param {deviceId} opts.projectId Device ID of interest
85
+ * @param opts.projectId Project public ID
86
+ * @param opts.projectId Device ID of interest
90
87
  *
91
88
  * @example
92
89
  * ```tsx
@@ -108,8 +105,7 @@ export declare function useSingleMember({ projectId, deviceId, }: {
108
105
  /**
109
106
  * Retrieve all members of a project.
110
107
  *
111
- * @param {Object} opts
112
- * @param {string} opts.projectId Project public ID
108
+ * @param opts.projectId Project public ID
113
109
  *
114
110
  * @example
115
111
  * ```tsx
@@ -132,10 +128,11 @@ export declare function useManyMembers({ projectId }: {
132
128
  *
133
129
  * _TODO: Explain bitmap opts vs svg opts_
134
130
  *
135
- * @param {Object} opts
136
- * @param {string} opts.projectId Project public ID
137
- * @param {string} opts.iconId Icon ID of interest
138
- * @param {BitmapOpts | SvgOpts} opts.opts Parameters related to the mime type of the icon of interest
131
+ * @param opts.projectId Project public ID
132
+ * @param opts.iconId Icon ID of interest
133
+ * @param opts.mimeType MIME type of desired resource
134
+ * @param opts.pixelDensity Pixel density resource (only applicable when `mimeType` is `'image/png'`)
135
+ * @param opts.size Size of desired resource
139
136
  *
140
137
  * @example
141
138
  * ```tsx
@@ -143,11 +140,9 @@ export declare function useManyMembers({ projectId }: {
143
140
  * const { data } = useIconUrl({
144
141
  * projectId: '...',
145
142
  * iconId: '...',
146
- * opts: {
147
- * mimeType: 'image/png',
148
- * pixelDensity: 1,
149
- * size: 'medium'
150
- * }
143
+ * mimeType: 'image/png',
144
+ * pixelDensity: 1,
145
+ * size: 'medium'
151
146
  * })
152
147
  * }
153
148
  * ```
@@ -157,19 +152,16 @@ export declare function useManyMembers({ projectId }: {
157
152
  * const { data } = useIconUrl({
158
153
  * projectId: '...',
159
154
  * iconId: '...',
160
- * opts: {
161
- * mimeType: 'image/svg',
162
- * size: 'medium'
163
- * }
155
+ * mimeType: 'image/svg',
156
+ * size: 'medium'
164
157
  * })
165
158
  * }
166
159
  * ```
167
160
  */
168
- export declare function useIconUrl({ projectId, iconId, opts, }: {
161
+ export declare function useIconUrl({ projectId, iconId, ...mimeBasedOpts }: {
169
162
  projectId: string;
170
163
  iconId: string;
171
- opts: Parameters<typeof iconUrlQueryOptions>[0]['opts'];
172
- }): {
164
+ } & (BitmapOpts | SvgOpts)): {
173
165
  data: string;
174
166
  error: Error | null;
175
167
  isRefetching: boolean;
@@ -179,9 +171,8 @@ export declare function useIconUrl({ projectId, iconId, opts, }: {
179
171
  *
180
172
  * _TODO: Explain BlobId in more depth_
181
173
  *
182
- * @param {Object} opts
183
- * @param {string} opts.projectId Project public Id
184
- * @param {BlobId} opts.blobId Blob ID of the desired resource
174
+ * @param opts.projectId Project public Id
175
+ * @param opts.blobId Blob ID of the desired resource
185
176
  *
186
177
  * @example
187
178
  * ```tsx
@@ -237,9 +228,8 @@ export declare function useAttachmentUrl({ projectId, blobId, }: {
237
228
  /**
238
229
  * Retrieve the device ID that created a document.
239
230
  *
240
- * @param {Object} opts
241
- * @param {string} opts.projectId Project public ID
242
- * @param {string} opts.originalVersionId Version ID of document
231
+ * @param opts.projectId Project public ID
232
+ * @param opts.originalVersionId Version ID of document
243
233
  *
244
234
  * @example
245
235
  * ```tsx
@@ -4,8 +4,7 @@ import { useClientApi } from './client';
4
4
  /**
5
5
  * Retrieve the project settings for a project.
6
6
  *
7
- * @param {Object} opts
8
- * @param {string} opts.projectId Project public ID
7
+ * @param opts.projectId Project public ID
9
8
  *
10
9
  * @example
11
10
  * ```tsx
@@ -33,8 +32,7 @@ export function useProjectSettings({ projectId }) {
33
32
  *
34
33
  * This is mostly used internally by the other hooks and should only be used if certain project APIs are not exposed via the hooks.
35
34
  *
36
- * @param {Object} opts
37
- * @param {string} opts.projectId Project public ID
35
+ * @param opts.projectId Project public ID
38
36
  *
39
37
  * @example
40
38
  * ```tsx
@@ -81,9 +79,8 @@ export function useManyProjects() {
81
79
  /**
82
80
  * Retrieve a single member of a project.
83
81
  *
84
- * @param {Object} opts
85
- * @param {string} opts.projectId Project public ID
86
- * @param {deviceId} opts.projectId Device ID of interest
82
+ * @param opts.projectId Project public ID
83
+ * @param opts.projectId Device ID of interest
87
84
  *
88
85
  * @example
89
86
  * ```tsx
@@ -106,8 +103,7 @@ export function useSingleMember({ projectId, deviceId, }) {
106
103
  /**
107
104
  * Retrieve all members of a project.
108
105
  *
109
- * @param {Object} opts
110
- * @param {string} opts.projectId Project public ID
106
+ * @param opts.projectId Project public ID
111
107
  *
112
108
  * @example
113
109
  * ```tsx
@@ -128,10 +124,11 @@ export function useManyMembers({ projectId }) {
128
124
  *
129
125
  * _TODO: Explain bitmap opts vs svg opts_
130
126
  *
131
- * @param {Object} opts
132
- * @param {string} opts.projectId Project public ID
133
- * @param {string} opts.iconId Icon ID of interest
134
- * @param {BitmapOpts | SvgOpts} opts.opts Parameters related to the mime type of the icon of interest
127
+ * @param opts.projectId Project public ID
128
+ * @param opts.iconId Icon ID of interest
129
+ * @param opts.mimeType MIME type of desired resource
130
+ * @param opts.pixelDensity Pixel density resource (only applicable when `mimeType` is `'image/png'`)
131
+ * @param opts.size Size of desired resource
135
132
  *
136
133
  * @example
137
134
  * ```tsx
@@ -139,11 +136,9 @@ export function useManyMembers({ projectId }) {
139
136
  * const { data } = useIconUrl({
140
137
  * projectId: '...',
141
138
  * iconId: '...',
142
- * opts: {
143
- * mimeType: 'image/png',
144
- * pixelDensity: 1,
145
- * size: 'medium'
146
- * }
139
+ * mimeType: 'image/png',
140
+ * pixelDensity: 1,
141
+ * size: 'medium'
147
142
  * })
148
143
  * }
149
144
  * ```
@@ -153,21 +148,19 @@ export function useManyMembers({ projectId }) {
153
148
  * const { data } = useIconUrl({
154
149
  * projectId: '...',
155
150
  * iconId: '...',
156
- * opts: {
157
- * mimeType: 'image/svg',
158
- * size: 'medium'
159
- * }
151
+ * mimeType: 'image/svg',
152
+ * size: 'medium'
160
153
  * })
161
154
  * }
162
155
  * ```
163
156
  */
164
- export function useIconUrl({ projectId, iconId, opts, }) {
157
+ export function useIconUrl({ projectId, iconId, ...mimeBasedOpts }) {
165
158
  const { data: projectApi } = useSingleProject({ projectId });
166
159
  const { data, error, isRefetching } = useSuspenseQuery(iconUrlQueryOptions({
160
+ ...mimeBasedOpts,
167
161
  projectApi,
168
162
  projectId,
169
163
  iconId,
170
- opts,
171
164
  }));
172
165
  return { data, error, isRefetching };
173
166
  }
@@ -176,9 +169,8 @@ export function useIconUrl({ projectId, iconId, opts, }) {
176
169
  *
177
170
  * _TODO: Explain BlobId in more depth_
178
171
  *
179
- * @param {Object} opts
180
- * @param {string} opts.projectId Project public Id
181
- * @param {BlobId} opts.blobId Blob ID of the desired resource
172
+ * @param opts.projectId Project public Id
173
+ * @param opts.blobId Blob ID of the desired resource
182
174
  *
183
175
  * @example
184
176
  * ```tsx
@@ -236,9 +228,8 @@ export function useAttachmentUrl({ projectId, blobId, }) {
236
228
  /**
237
229
  * Retrieve the device ID that created a document.
238
230
  *
239
- * @param {Object} opts
240
- * @param {string} opts.projectId Project public ID
241
- * @param {string} opts.originalVersionId Version ID of document
231
+ * @param opts.projectId Project public ID
232
+ * @param opts.originalVersionId Version ID of document
242
233
  *
243
234
  * @example
244
235
  * ```tsx
@@ -1,7 +1,7 @@
1
1
  import type { MapeoClientApi } from '@comapeo/ipc';
2
2
  export declare function getClientQueryKey(): readonly ["@comapeo/core-react", "client"];
3
3
  export declare function getDeviceInfoQueryKey(): readonly ["@comapeo/core-react", "client", "device_info"];
4
- export declare function getIsArchiveDeviceQueryKey(): readonly ["@comapeo/core-react", "client", "is_remote_archive"];
4
+ export declare function getIsArchiveDeviceQueryKey(): readonly ["@comapeo/core-react", "client", "is_archive_device"];
5
5
  export declare function deviceInfoQueryOptions({ clientApi, }: {
6
6
  clientApi: MapeoClientApi;
7
7
  }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
@@ -7,7 +7,7 @@ export function getDeviceInfoQueryKey() {
7
7
  return [ROOT_QUERY_KEY, 'client', 'device_info'];
8
8
  }
9
9
  export function getIsArchiveDeviceQueryKey() {
10
- return [ROOT_QUERY_KEY, 'client', 'is_remote_archive'];
10
+ return [ROOT_QUERY_KEY, 'client', 'is_archive_device'];
11
11
  }
12
12
  export function deviceInfoQueryOptions({ clientApi, }) {
13
13
  return queryOptions({
@@ -5,28 +5,37 @@ export declare function getDocumentsQueryKey<D extends DocumentType>({ projectId
5
5
  projectId: string;
6
6
  docType: D;
7
7
  }): readonly ["@comapeo/core-react", "projects", string, D];
8
- export declare function getManyDocumentsQueryKey<D extends DocumentType>({ projectId, docType, opts, }: {
8
+ export declare function getManyDocumentsQueryKey<D extends DocumentType>({ projectId, docType, includeDeleted, lang, }: {
9
9
  projectId: string;
10
10
  docType: D;
11
- opts?: Parameters<MapeoProjectApi[D]['getMany']>[0];
12
- }): readonly ["@comapeo/core-react", "projects", string, D, Parameters<import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>[D]["getMany"]>[0] | undefined];
13
- export declare function getDocumentByDocIdQueryKey<D extends DocumentType>({ projectId, docType, docId, opts, }: {
11
+ includeDeleted?: boolean;
12
+ lang?: string;
13
+ }): readonly ["@comapeo/core-react", "projects", string, D, {
14
+ readonly includeDeleted: boolean | undefined;
15
+ readonly lang: string | undefined;
16
+ }];
17
+ export declare function getDocumentByDocIdQueryKey<D extends DocumentType>({ projectId, docType, docId, lang, }: {
14
18
  projectId: string;
15
19
  docType: D;
16
- docId: Parameters<MapeoProjectApi[D]['getByDocId']>[0];
17
- opts?: Parameters<MapeoProjectApi[D]['getByDocId']>[1];
18
- }): readonly ["@comapeo/core-react", "projects", string, D, Parameters<import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>[D]["getByDocId"]>[0], Parameters<import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>[D]["getByDocId"]>[1] | undefined];
19
- export declare function getDocumentByVersionIdQueryKey<D extends DocumentType>({ projectId, docType, versionId, opts, }: {
20
+ docId: string;
21
+ lang?: string;
22
+ }): readonly ["@comapeo/core-react", "projects", string, D, string, {
23
+ readonly lang: string | undefined;
24
+ }];
25
+ export declare function getDocumentByVersionIdQueryKey<D extends DocumentType>({ projectId, docType, versionId, lang, }: {
20
26
  projectId: string;
21
27
  docType: D;
22
- versionId: Parameters<MapeoProjectApi[D]['getByVersionId']>[0];
23
- opts?: Parameters<MapeoProjectApi[D]['getByVersionId']>[1];
24
- }): readonly ["@comapeo/core-react", "projects", string, D, Parameters<import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>[D]["getByVersionId"]>[0], Parameters<import("rpc-reflector/lib/types").ClientApi<import("@comapeo/core/dist/mapeo-project").MapeoProject>[D]["getByVersionId"]>[1] | undefined];
25
- export declare function documentsQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, opts, }: {
28
+ versionId: string;
29
+ lang?: string;
30
+ }): readonly ["@comapeo/core-react", "projects", string, D, string, {
31
+ readonly lang: string | undefined;
32
+ }];
33
+ export declare function documentsQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, includeDeleted, lang, }: {
26
34
  projectApi: MapeoProjectApi;
27
35
  projectId: string;
28
36
  docType: D;
29
- opts?: Parameters<MapeoProjectApi[D]['getMany']>[0];
37
+ includeDeleted?: boolean;
38
+ lang?: string;
30
39
  }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
31
40
  schemaName: "track";
32
41
  locations: import("@comapeo/schema/dist/schema/track").Position[];
@@ -524,12 +533,12 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
524
533
  forks: string[];
525
534
  })[]>;
526
535
  };
527
- export declare function documentByDocumentIdQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, docId, opts, }: {
536
+ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, docId, lang, }: {
528
537
  projectApi: MapeoProjectApi;
529
538
  projectId: string;
530
539
  docType: D;
531
- docId: Parameters<MapeoProjectApi[D]['getByDocId']>[0];
532
- opts?: Omit<Parameters<MapeoProjectApi[D]['getByDocId']>[1], 'mustBeFound'>;
540
+ docId: string;
541
+ lang?: string;
533
542
  }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
534
543
  schemaName: "track";
535
544
  locations: import("@comapeo/schema/dist/schema/track").Position[];
@@ -1027,12 +1036,12 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
1027
1036
  forks: string[];
1028
1037
  })>;
1029
1038
  };
1030
- export declare function documentByVersionIdQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, versionId, opts, }: {
1039
+ export declare function documentByVersionIdQueryOptions<D extends DocumentType>({ projectApi, projectId, docType, versionId, lang, }: {
1031
1040
  projectApi: MapeoProjectApi;
1032
1041
  projectId: string;
1033
1042
  docType: D;
1034
- versionId: Parameters<MapeoProjectApi[D]['getByVersionId']>[0];
1035
- opts?: Parameters<MapeoProjectApi[D]['getByVersionId']>[1];
1043
+ versionId: string;
1044
+ lang?: string;
1036
1045
  }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
1037
1046
  schemaName: "track";
1038
1047
  locations: import("@comapeo/schema/dist/schema/track").Position[];
@@ -3,60 +3,81 @@ import { baseQueryOptions, ROOT_QUERY_KEY } from './shared';
3
3
  export function getDocumentsQueryKey({ projectId, docType, }) {
4
4
  return [ROOT_QUERY_KEY, 'projects', projectId, docType];
5
5
  }
6
- export function getManyDocumentsQueryKey({ projectId, docType, opts, }) {
7
- return [ROOT_QUERY_KEY, 'projects', projectId, docType, opts];
6
+ export function getManyDocumentsQueryKey({ projectId, docType, includeDeleted, lang, }) {
7
+ return [
8
+ ROOT_QUERY_KEY,
9
+ 'projects',
10
+ projectId,
11
+ docType,
12
+ { includeDeleted, lang },
13
+ ];
8
14
  }
9
- export function getDocumentByDocIdQueryKey({ projectId, docType, docId, opts, }) {
10
- return [ROOT_QUERY_KEY, 'projects', projectId, docType, docId, opts];
15
+ export function getDocumentByDocIdQueryKey({ projectId, docType, docId, lang, }) {
16
+ return [
17
+ ROOT_QUERY_KEY,
18
+ 'projects',
19
+ projectId,
20
+ docType,
21
+ docId,
22
+ { lang },
23
+ ];
11
24
  }
12
- export function getDocumentByVersionIdQueryKey({ projectId, docType, versionId, opts, }) {
25
+ export function getDocumentByVersionIdQueryKey({ projectId, docType, versionId, lang, }) {
13
26
  return [
14
27
  ROOT_QUERY_KEY,
15
28
  'projects',
16
29
  projectId,
17
30
  docType,
18
31
  versionId,
19
- opts,
32
+ { lang },
20
33
  ];
21
34
  }
22
- export function documentsQueryOptions({ projectApi, projectId, docType, opts, }) {
35
+ export function documentsQueryOptions({ projectApi, projectId, docType, includeDeleted, lang, }) {
23
36
  return queryOptions({
24
37
  ...baseQueryOptions(),
25
- queryKey: getManyDocumentsQueryKey({ projectId, docType, opts }),
38
+ queryKey: getManyDocumentsQueryKey({
39
+ projectId,
40
+ docType,
41
+ includeDeleted,
42
+ lang,
43
+ }),
26
44
  queryFn: async () => {
27
- return projectApi[docType].getMany(opts);
45
+ return projectApi[docType].getMany({
46
+ includeDeleted,
47
+ lang,
48
+ });
28
49
  },
29
50
  });
30
51
  }
31
- export function documentByDocumentIdQueryOptions({ projectApi, projectId, docType, docId, opts, }) {
52
+ export function documentByDocumentIdQueryOptions({ projectApi, projectId, docType, docId, lang, }) {
32
53
  return queryOptions({
33
54
  ...baseQueryOptions(),
34
55
  queryKey: getDocumentByDocIdQueryKey({
35
56
  projectId,
36
57
  docType,
37
58
  docId,
38
- opts,
59
+ lang,
39
60
  }),
40
61
  queryFn: async () => {
41
62
  return projectApi[docType].getByDocId(docId, {
42
- ...opts,
63
+ lang,
43
64
  // We want to make sure that this throws in the case that no match is found
44
65
  mustBeFound: true,
45
66
  });
46
67
  },
47
68
  });
48
69
  }
49
- export function documentByVersionIdQueryOptions({ projectApi, projectId, docType, versionId, opts, }) {
70
+ export function documentByVersionIdQueryOptions({ projectApi, projectId, docType, versionId, lang, }) {
50
71
  return queryOptions({
51
72
  ...baseQueryOptions(),
52
73
  queryKey: getDocumentByVersionIdQueryKey({
53
74
  projectId,
54
75
  docType,
55
76
  versionId,
56
- opts,
77
+ lang,
57
78
  }),
58
79
  queryFn: async () => {
59
- return projectApi[docType].getByVersionId(versionId, opts);
80
+ return projectApi[docType].getByVersionId(versionId, { lang });
60
81
  },
61
82
  });
62
83
  }
@@ -1,3 +1,4 @@
1
+ import type { BitmapOpts, SvgOpts } from '@comapeo/core/dist/icon-api';
1
2
  import type { BlobId } from '@comapeo/core/dist/types.js';
2
3
  import type { MapeoClientApi, MapeoProjectApi } from '@comapeo/ipc';
3
4
  export declare function getProjectsQueryKey(): readonly ["@comapeo/core-react", "projects"];
@@ -17,11 +18,19 @@ export declare function getMemberByIdQueryKey({ projectId, deviceId, }: {
17
18
  projectId: string;
18
19
  deviceId: string;
19
20
  }): readonly ["@comapeo/core-react", "projects", string, "members", string];
20
- export declare function getIconUrlQueryKey({ projectId, iconId, opts, }: {
21
- projectId: string;
22
- iconId: Parameters<MapeoProjectApi['$icons']['getIconUrl']>[0];
23
- opts: Parameters<MapeoProjectApi['$icons']['getIconUrl']>[1];
24
- }): readonly ["@comapeo/core-react", "projects", string, "icons", string, import("@comapeo/core/dist/icon-api").BitmapOpts | import("@comapeo/core/dist/icon-api").SvgOpts];
21
+ export declare function getIconUrlQueryKey({ projectId, iconId, ...mimeBasedOpts }: {
22
+ projectId: string;
23
+ iconId: string;
24
+ } & (BitmapOpts | SvgOpts)): readonly ["@comapeo/core-react", "projects", string, "icons", string, {
25
+ mimeType: Extract<import("@comapeo/core/dist/icon-api").IconVariant["mimeType"], "image/png">;
26
+ pixelDensity: Extract<import("@comapeo/core/dist/icon-api").IconVariant, {
27
+ mimeType: "image/png";
28
+ }>["pixelDensity"];
29
+ size: import("@comapeo/core/dist/icon-api").ValidSizes;
30
+ } | {
31
+ mimeType: Extract<import("@comapeo/core/dist/icon-api").IconVariant["mimeType"], "image/svg+xml">;
32
+ size: import("@comapeo/core/dist/icon-api").ValidSizes;
33
+ }];
25
34
  export declare function getDocumentCreatedByQueryKey({ projectId, originalVersionId, }: {
26
35
  projectId: string;
27
36
  originalVersionId: string;
@@ -158,12 +167,11 @@ export declare function projectOwnRoleQueryOptions({ projectApi, projectId, }: {
158
167
  } & {
159
168
  queryKey: import("@tanstack/query-core").DataTag<import("@tanstack/query-core").QueryKey, import("@comapeo/core/dist/roles").Role<"a12a6702b93bd7ff" | "f7c150f5a3a9a855" | "012fd2d431c0bf60" | "9e6d29263cba36c9" | "8ced989b1904606b" | "08e4251e36f6e7ed">>;
160
169
  };
161
- export declare function iconUrlQueryOptions({ projectApi, projectId, iconId, opts, }: {
170
+ export declare function iconUrlQueryOptions({ projectApi, projectId, iconId, ...mimeBasedOpts }: {
162
171
  projectApi: MapeoProjectApi;
163
172
  projectId: string;
164
173
  iconId: Parameters<MapeoProjectApi['$icons']['getIconUrl']>[0];
165
- opts: Parameters<MapeoProjectApi['$icons']['getIconUrl']>[1];
166
- }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<string, Error, string, import("@tanstack/query-core").QueryKey>, "queryFn"> & {
174
+ } & (BitmapOpts | SvgOpts)): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<string, Error, string, import("@tanstack/query-core").QueryKey>, "queryFn"> & {
167
175
  queryFn?: import("@tanstack/query-core").QueryFunction<string, import("@tanstack/query-core").QueryKey, never> | undefined;
168
176
  } & {
169
177
  queryKey: import("@tanstack/query-core").DataTag<import("@tanstack/query-core").QueryKey, string>;
@@ -18,8 +18,15 @@ export function getMembersQueryKey({ projectId }) {
18
18
  export function getMemberByIdQueryKey({ projectId, deviceId, }) {
19
19
  return [ROOT_QUERY_KEY, 'projects', projectId, 'members', deviceId];
20
20
  }
21
- export function getIconUrlQueryKey({ projectId, iconId, opts, }) {
22
- return [ROOT_QUERY_KEY, 'projects', projectId, 'icons', iconId, opts];
21
+ export function getIconUrlQueryKey({ projectId, iconId, ...mimeBasedOpts }) {
22
+ return [
23
+ ROOT_QUERY_KEY,
24
+ 'projects',
25
+ projectId,
26
+ 'icons',
27
+ iconId,
28
+ mimeBasedOpts,
29
+ ];
23
30
  }
24
31
  export function getDocumentCreatedByQueryKey({ projectId, originalVersionId, }) {
25
32
  return [
@@ -87,12 +94,12 @@ export function projectOwnRoleQueryOptions({ projectApi, projectId, }) {
87
94
  },
88
95
  });
89
96
  }
90
- export function iconUrlQueryOptions({ projectApi, projectId, iconId, opts, }) {
97
+ export function iconUrlQueryOptions({ projectApi, projectId, iconId, ...mimeBasedOpts }) {
91
98
  return queryOptions({
92
99
  ...baseQueryOptions(),
93
- queryKey: getIconUrlQueryKey({ projectId, iconId, opts }),
100
+ queryKey: getIconUrlQueryKey({ ...mimeBasedOpts, projectId, iconId }),
94
101
  queryFn: async () => {
95
- return projectApi.$icons.getIconUrl(iconId, opts);
102
+ return projectApi.$icons.getIconUrl(iconId, mimeBasedOpts);
96
103
  },
97
104
  });
98
105
  }