@comapeo/core-react 3.1.0 → 3.2.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/hooks/client.d.ts +19 -2
- package/dist/commonjs/hooks/client.js +8 -4
- package/dist/commonjs/hooks/documents.d.ts +34 -3
- package/dist/commonjs/hooks/documents.js +12 -6
- package/dist/commonjs/hooks/invites.d.ts +39 -4
- package/dist/commonjs/hooks/invites.js +16 -8
- package/dist/commonjs/hooks/projects.d.ts +82 -8
- package/dist/commonjs/hooks/projects.js +32 -16
- package/dist/esm/hooks/client.d.ts +19 -2
- package/dist/esm/hooks/client.js +8 -4
- package/dist/esm/hooks/documents.d.ts +34 -3
- package/dist/esm/hooks/documents.js +12 -6
- package/dist/esm/hooks/invites.d.ts +39 -4
- package/dist/esm/hooks/invites.js +16 -8
- package/dist/esm/hooks/projects.d.ts +82 -8
- package/dist/esm/hooks/projects.js +32 -16
- package/docs/API.md +17 -17
- package/package.json +1 -1
package/docs/API.md
CHANGED
|
@@ -120,7 +120,7 @@ Update the device info for the current device.
|
|
|
120
120
|
|
|
121
121
|
| Function | Type |
|
|
122
122
|
| ---------- | ---------- |
|
|
123
|
-
| `useSetOwnDeviceInfo` | `() => { mutate: UseMutateFunction<void, Error, { name: string; deviceType: "device_type_unspecified" or "mobile" or "tablet" or "desktop" or "selfHostedServer" or "UNRECOGNIZED"; }, unknown>; reset: () => void; status: "
|
|
123
|
+
| `useSetOwnDeviceInfo` | `() => { error: Error; mutate: UseMutateFunction<void, Error, { name: string; deviceType: "device_type_unspecified" or "mobile" or "tablet" or "desktop" or "selfHostedServer" or "UNRECOGNIZED"; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
124
124
|
|
|
125
125
|
### useSetIsArchiveDevice
|
|
126
126
|
|
|
@@ -128,7 +128,7 @@ Set or unset the current device as an archive device.
|
|
|
128
128
|
|
|
129
129
|
| Function | Type |
|
|
130
130
|
| ---------- | ---------- |
|
|
131
|
-
| `useSetIsArchiveDevice` | `() => { mutate: UseMutateFunction<void, Error, { isArchiveDevice: boolean; }, unknown>; reset: () => void; status: "
|
|
131
|
+
| `useSetIsArchiveDevice` | `() => { error: Error; mutate: UseMutateFunction<void, Error, { isArchiveDevice: boolean; }, unknown>; reset: () => void; status: "error"; } or { error: null; mutate: UseMutateFunction<...>; reset: () => void; status: "pending" or ... 1 more ... or "idle"; }` |
|
|
132
132
|
|
|
133
133
|
### useProjectSettings
|
|
134
134
|
|
|
@@ -407,7 +407,7 @@ function BasicExample() {
|
|
|
407
407
|
|
|
408
408
|
| Function | Type |
|
|
409
409
|
| ---------- | ---------- |
|
|
410
|
-
| `useAddServerPeer` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<void, Error, { baseUrl: string; dangerouslyAllowInsecureConnections?: boolean or undefined; }, unknown>; reset: () => void; status: "
|
|
410
|
+
| `useAddServerPeer` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<void, Error, { baseUrl: string; dangerouslyAllowInsecureConnections?: boolean or undefined; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
411
411
|
|
|
412
412
|
### useCreateProject
|
|
413
413
|
|
|
@@ -415,7 +415,7 @@ Create a new project.
|
|
|
415
415
|
|
|
416
416
|
| Function | Type |
|
|
417
417
|
| ---------- | ---------- |
|
|
418
|
-
| `useCreateProject` | `() => { mutate: UseMutateFunction<string, Error, { name?: string or undefined; configPath?: string or undefined; } or undefined, unknown>; reset: () => void; status: "
|
|
418
|
+
| `useCreateProject` | `() => { error: Error; mutate: UseMutateFunction<string, Error, { name?: string or undefined; configPath?: string or undefined; } or undefined, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
419
419
|
|
|
420
420
|
### useLeaveProject
|
|
421
421
|
|
|
@@ -423,7 +423,7 @@ Leave an existing project.
|
|
|
423
423
|
|
|
424
424
|
| Function | Type |
|
|
425
425
|
| ---------- | ---------- |
|
|
426
|
-
| `useLeaveProject` | `() => { mutate: UseMutateFunction<void, Error, { projectId: string; }, unknown>; reset: () => void; status: "
|
|
426
|
+
| `useLeaveProject` | `() => { error: Error; mutate: UseMutateFunction<void, Error, { projectId: string; }, unknown>; reset: () => void; status: "error"; } or { error: null; mutate: UseMutateFunction<void, Error, { ...; }, unknown>; reset: () => void; status: "pending" or ... 1 more ... or "idle"; }` |
|
|
427
427
|
|
|
428
428
|
### useImportProjectConfig
|
|
429
429
|
|
|
@@ -431,7 +431,7 @@ Update the configuration of a project using an external file.
|
|
|
431
431
|
|
|
432
432
|
| Function | Type |
|
|
433
433
|
| ---------- | ---------- |
|
|
434
|
-
| `useImportProjectConfig` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<Error[], Error, { configPath: string; }, unknown>; reset: () => void; status: "
|
|
434
|
+
| `useImportProjectConfig` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<Error[], Error, { configPath: string; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
435
435
|
|
|
436
436
|
Parameters:
|
|
437
437
|
|
|
@@ -444,7 +444,7 @@ Update the settings of a project.
|
|
|
444
444
|
|
|
445
445
|
| Function | Type |
|
|
446
446
|
| ---------- | ---------- |
|
|
447
|
-
| `useUpdateProjectSettings` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<EditableProjectSettings, Error, { name?: string or undefined; configMetadata?: {
|
|
447
|
+
| `useUpdateProjectSettings` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<EditableProjectSettings, Error, { name?: string or undefined; configMetadata?: { ...; } or undefined; defaultPresets?: { ...; } or undefined; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
448
448
|
|
|
449
449
|
Parameters:
|
|
450
450
|
|
|
@@ -457,7 +457,7 @@ Create a blob for a project.
|
|
|
457
457
|
|
|
458
458
|
| Function | Type |
|
|
459
459
|
| ---------- | ---------- |
|
|
460
|
-
| `useCreateBlob` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<{ driveId: string; name: string; type: "photo" or "audio" or "video"; hash: string; }, Error, { original: string; preview?: string or undefined; thumbnail?: string or undefined; metadata: Metadata; }, unknown>; reset: () => void; status
|
|
460
|
+
| `useCreateBlob` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<{ driveId: string; name: string; type: "photo" or "audio" or "video"; hash: string; }, Error, { original: string; preview?: string or undefined; thumbnail?: string or undefined; metadata: Metadata; }, unknown>; reset: () => void; status...` |
|
|
461
461
|
|
|
462
462
|
Parameters:
|
|
463
463
|
|
|
@@ -508,13 +508,13 @@ Provides the progress of data sync for sync-enabled connected peers
|
|
|
508
508
|
|
|
509
509
|
| Function | Type |
|
|
510
510
|
| ---------- | ---------- |
|
|
511
|
-
| `useStartSync` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<void, Error, { autostopDataSyncAfter: number or null; } or undefined, unknown>; reset: () => void; status: "
|
|
511
|
+
| `useStartSync` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<void, Error, { autostopDataSyncAfter: number or null; } or undefined, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
512
512
|
|
|
513
513
|
### useStopSync
|
|
514
514
|
|
|
515
515
|
| Function | Type |
|
|
516
516
|
| ---------- | ---------- |
|
|
517
|
-
| `useStopSync` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<void, Error, void, unknown>; reset: () => void; status: "
|
|
517
|
+
| `useStopSync` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<void, Error, void, unknown>; reset: () => void; status: "error"; } or { error: null; mutate: UseMutateFunction<...>; reset: () => void; status: "pending" or ... 1 more ... or "idle"; }` |
|
|
518
518
|
|
|
519
519
|
### useSingleDocByDocId
|
|
520
520
|
|
|
@@ -634,7 +634,7 @@ Create a document for a project.
|
|
|
634
634
|
|
|
635
635
|
| Function | Type |
|
|
636
636
|
| ---------- | ---------- |
|
|
637
|
-
| `useCreateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, {
|
|
637
|
+
| `useCreateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { error: Error; mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, { ...; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
638
638
|
|
|
639
639
|
Parameters:
|
|
640
640
|
|
|
@@ -648,7 +648,7 @@ Update a document within a project.
|
|
|
648
648
|
|
|
649
649
|
| Function | Type |
|
|
650
650
|
| ---------- | ---------- |
|
|
651
|
-
| `useUpdateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, {
|
|
651
|
+
| `useUpdateDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { error: Error; mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, { ...; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
652
652
|
|
|
653
653
|
Parameters:
|
|
654
654
|
|
|
@@ -662,7 +662,7 @@ Delete a document within a project.
|
|
|
662
662
|
|
|
663
663
|
| Function | Type |
|
|
664
664
|
| ---------- | ---------- |
|
|
665
|
-
| `useDeleteDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, {
|
|
665
|
+
| `useDeleteDocument` | `<D extends WriteableDocumentType>({ docType, projectId, }: { docType: D; projectId: string; }) => { error: Error; mutate: UseMutateFunction<WriteableDocument<D> and { forks: string[]; }, Error, { ...; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
666
666
|
|
|
667
667
|
Parameters:
|
|
668
668
|
|
|
@@ -676,7 +676,7 @@ Accept an invite that has been received.
|
|
|
676
676
|
|
|
677
677
|
| Function | Type |
|
|
678
678
|
| ---------- | ---------- |
|
|
679
|
-
| `useAcceptInvite` | `() => { mutate: UseMutateFunction<string, Error, { inviteId: string; }, unknown>; reset: () => void; status: "
|
|
679
|
+
| `useAcceptInvite` | `() => { error: Error; mutate: UseMutateFunction<string, Error, { inviteId: string; }, unknown>; reset: () => void; status: "error"; } or { error: null; mutate: UseMutateFunction<string, Error, { ...; }, unknown>; reset: () => void; status: "pending" or ... 1 more ... or "idle"; }` |
|
|
680
680
|
|
|
681
681
|
### useRejectInvite
|
|
682
682
|
|
|
@@ -684,7 +684,7 @@ Reject an invite that has been received.
|
|
|
684
684
|
|
|
685
685
|
| Function | Type |
|
|
686
686
|
| ---------- | ---------- |
|
|
687
|
-
| `useRejectInvite` | `() => { mutate: UseMutateFunction<void, Error, { inviteId: string; }, unknown>; reset: () => void; status: "
|
|
687
|
+
| `useRejectInvite` | `() => { error: Error; mutate: UseMutateFunction<void, Error, { inviteId: string; }, unknown>; reset: () => void; status: "error"; } or { error: null; mutate: UseMutateFunction<void, Error, { ...; }, unknown>; reset: () => void; status: "pending" or ... 1 more ... or "idle"; }` |
|
|
688
688
|
|
|
689
689
|
### useSendInvite
|
|
690
690
|
|
|
@@ -692,7 +692,7 @@ Send an invite for a project.
|
|
|
692
692
|
|
|
693
693
|
| Function | Type |
|
|
694
694
|
| ---------- | ---------- |
|
|
695
|
-
| `useSendInvite` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<"ACCEPT" or "REJECT" or "ALREADY", Error, { deviceId: string; roleDescription?: string or undefined; roleId: "f7c150f5a3a9a855" or "012fd2d431c0bf60" or "9e6d29263cba36c9"; roleName?: string or undefined; }, unknown>; reset: () => void;
|
|
695
|
+
| `useSendInvite` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<"ACCEPT" or "REJECT" or "ALREADY", Error, { deviceId: string; roleDescription?: string or undefined; roleId: "f7c150f5a3a9a855" or "012fd2d431c0bf60" or "9e6d29263cba36c9"; roleName?: string or undefined; }, unknown>; reset: () => void; s...` |
|
|
696
696
|
|
|
697
697
|
Parameters:
|
|
698
698
|
|
|
@@ -705,7 +705,7 @@ Request a cancellation of an invite sent to another device.
|
|
|
705
705
|
|
|
706
706
|
| Function | Type |
|
|
707
707
|
| ---------- | ---------- |
|
|
708
|
-
| `useRequestCancelInvite` | `({ projectId }: { projectId: string; }) => { mutate: UseMutateFunction<void, Error, { deviceId: string; }, unknown>; reset: () => void; status: "
|
|
708
|
+
| `useRequestCancelInvite` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<void, Error, { deviceId: string; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
709
709
|
|
|
710
710
|
Parameters:
|
|
711
711
|
|