Skip to content

Commit

Permalink
update tsdoc annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Dec 16, 2024
1 parent e30c277 commit 7cac7ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/contexts/ClientApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const ClientApiContext = createContext<MapeoClientApi | null>(null)
/**
* Create a context provider that holds a CoMapeo API client instance.
*
* @param {Object} opts
* @param opts
* @param {ReactNode} opts.children React children node
* @param {MapeoClientApi} opts.clientApi Client API instance
*/
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
* Access a client API instance. If a ClientApiContext provider is not
* set up, it will throw an error.
*
* @returns {import('@comapeo/ipc').MapeoClientApi} Client API instance
* @returns Client API instance
*
* @example
* ```tsx
Expand Down
19 changes: 8 additions & 11 deletions src/hooks/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import { useSingleProject } from './projects'
*
* Triggers the closest error boundary if the document cannot be found
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param {DocumentType} opts.docType Document type of interest
* @param {string} opts.docId Document ID
* @param {string} [opts.lang] Language to translate the document into
* @param opts.projectId Project public ID
* @param opts.docType Document type of interest
* @param opts.docId Document ID
* @param opts.lang Language to translate the document into
*
* @example
* ```tsx
Expand Down Expand Up @@ -65,11 +64,10 @@ export function useSingleDocByDocId<D extends DocumentType>({
*
* Triggers the closest error boundary if the document cannot be found.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param {DocumentType} opts.docType Document type of interest
* @param {string} opts.versionId Document's version ID
* @param {string} [opts.lang] Language to translate the document into
* @param opts.projectId Project public ID
* @param opts.docType Document type of interest
* @param opts.versionId Document's version ID
* @param opts.lang Language to translate the document into
*
* * @example
* ```tsx
Expand Down Expand Up @@ -114,7 +112,6 @@ export function useSingleDocByVersionId<D extends DocumentType>({
/**
* Retrieve all documents of a specific `docType`.
*
* @param {Object} opts
* @param opts.projectId Project public ID
* @param opts.docType Document type of interest
* @param opts.includeDeleted Include documents that have been marked as deleted
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { useClientApi } from './client'
* If `opts.refreshToken` is specified, it will be appended to the returned URL as a search param. This is useful for forcing cache busting
* due to hidden internal details by consuming components (e.g. map component from MapLibre).
*
* @param {Object} opts
* @param {string} opts.refreshToken String to append to the returned value as a search param
* @param opts.refreshToken String to append to the returned value as a search param
*
* @example
* ```tsx
Expand Down
25 changes: 9 additions & 16 deletions src/hooks/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { useClientApi } from './client'
/**
* Retrieve the project settings for a project.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param opts.projectId Project public ID
*
* @example
* ```tsx
Expand Down Expand Up @@ -54,8 +53,7 @@ export function useProjectSettings({ projectId }: { projectId: string }) {
*
* This is mostly used internally by the other hooks and should only be used if certain project APIs are not exposed via the hooks.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param opts.projectId Project public ID
*
* @example
* ```tsx
Expand Down Expand Up @@ -110,9 +108,8 @@ export function useManyProjects() {
/**
* Retrieve a single member of a project.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param {deviceId} opts.projectId Device ID of interest
* @param opts.projectId Project public ID
* @param opts.projectId Device ID of interest
*
* @example
* ```tsx
Expand Down Expand Up @@ -146,8 +143,7 @@ export function useSingleMember({
/**
* Retrieve all members of a project.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param opts.projectId Project public ID
*
* @example
* ```tsx
Expand All @@ -173,7 +169,6 @@ export function useManyMembers({ projectId }: { projectId: string }) {
*
* _TODO: Explain bitmap opts vs svg opts_
*
* @param {Object} opts
* @param opts.projectId Project public ID
* @param opts.iconId Icon ID of interest
* @param opts.mimeType MIME type of desired resource
Expand Down Expand Up @@ -231,9 +226,8 @@ export function useIconUrl({
*
* _TODO: Explain BlobId in more depth_
*
* @param {Object} opts
* @param {string} opts.projectId Project public Id
* @param {BlobId} opts.blobId Blob ID of the desired resource
* @param opts.projectId Project public Id
* @param opts.blobId Blob ID of the desired resource
*
* @example
* ```tsx
Expand Down Expand Up @@ -302,9 +296,8 @@ export function useAttachmentUrl({
/**
* Retrieve the device ID that created a document.
*
* @param {Object} opts
* @param {string} opts.projectId Project public ID
* @param {string} opts.originalVersionId Version ID of document
* @param opts.projectId Project public ID
* @param opts.originalVersionId Version ID of document
*
* @example
* ```tsx
Expand Down

0 comments on commit 7cac7ac

Please sign in to comment.