From 9d8a046e9d4b65d3327ed8e13ee7436365853902 Mon Sep 17 00:00:00 2001 From: Andrew Chou Date: Thu, 9 Jan 2025 16:21:10 -0500 Subject: [PATCH] update api docs --- docs/API.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/docs/API.md b/docs/API.md index 3feaee4..b05e7ad 100644 --- a/docs/API.md +++ b/docs/API.md @@ -23,6 +23,9 @@ - [useSingleDocByDocId](#usesingledocbydocid) - [useSingleDocByVersionId](#usesingledocbyversionid) - [useManyDocs](#usemanydocs) +- [useCreateDocument](#usecreatedocument) +- [useUpdateDocument](#useupdatedocument) +- [useDeleteDocument](#usedeletedocument) - [useAcceptInvite](#useacceptinvite) - [useRejectInvite](#userejectinvite) - [useSendInvite](#usesendinvite) @@ -439,7 +442,7 @@ Triggers the closest error boundary if the document cannot be found | Function | Type | | ---------- | ---------- | -| `useSingleDocByDocId` | `({ projectId, docType, docId, lang, }: { projectId: string; docType: D; docId: string; lang?: string or undefined; }) => ReadHookResult({ projectId, docType, docId, lang, }: { projectId: string; docType: D; docId: string; lang?: string or undefined; }) => ReadHookResult({ projectId, docType, versionId, lang, }: { projectId: string; docType: D; versionId: string; lang?: string or undefined; }) => ReadHookResult({ projectId, docType, versionId, lang, }: { projectId: string; docType: D; versionId: string; lang?: string or undefined; }) => ReadHookResult({ projectId, docType, includeDeleted, lang, }: { projectId: string; docType: D; includeDeleted?: boolean or undefined; lang?: string or undefined; }) => ReadHookResult({ projectId, docType, includeDeleted, lang, }: { projectId: string; docType: D; includeDeleted?: boolean or undefined; lang?: string or undefined; }) => ReadHookResult({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction and { forks: string[]; }, Error, { value: Omit, "schemaName">; }, unknown>; reset: () => void; status: "pending" or ... 2 more ... or "idle"; }` | + +Parameters: + +* `opts.docType`: Document type to create. +* `opts.projectId`: Public ID of project to create document for. + + +### useUpdateDocument + +Update a document within a project. + +| Function | Type | +| ---------- | ---------- | +| `useUpdateDocument` | `({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction and { forks: string[]; }, Error, { versionId: string; value: Omit<...>; }, unknown>; reset: () => void; status: "pending" or ... 2 more ... or "idle"; }` | + +Parameters: + +* `opts.docType`: Document type to update. +* `opts.projectId`: Public ID of project document belongs to. + + +### useDeleteDocument + +Delete a document within a project. + +| Function | Type | +| ---------- | ---------- | +| `useDeleteDocument` | `({ docType, projectId, }: { docType: D; projectId: string; }) => { mutate: UseMutateFunction and { forks: string[]; }, Error, { docId: string; }, unknown>; reset: () => void; status: "pending" or ... 2 more ... or "idle"; }` | + +Parameters: + +* `opts.docType`: Document type to delete. +* `opts.projectId`: Public ID of project document belongs to. + + ### useAcceptInvite Accept an invite that has been received.