Sanity App SDK
    Preparing search index...

    Interface PaginatedDocumentsResponse<TDocumentType, TDataset, TProjectId>

    Return value from the usePaginatedDocuments hook

    interface PaginatedDocumentsResponse<
        TDocumentType extends string = string,
        TDataset extends string = string,
        TProjectId extends string = string,
    > {
        count: number;
        currentPage: number;
        data: DocumentHandle<TDocumentType, TDataset, TProjectId>[];
        endIndex: number;
        firstPage: () => void;
        goToPage: (pageNumber: number) => void;
        hasFirstPage: boolean;
        hasLastPage: boolean;
        hasNextPage: boolean;
        hasPreviousPage: boolean;
        isPending: boolean;
        lastPage: () => void;
        nextPage: () => void;
        pageSize: number;
        previousPage: () => void;
        startIndex: number;
        totalPages: number;
    }

    Type Parameters

    • TDocumentType extends string = string
    • TDataset extends string = string
    • TProjectId extends string = string
    Index

    Properties

    count: number

    Total count of items matching the query

    currentPage: number

    Current page number (1-indexed)

    Array of document handles for the current page

    endIndex: number

    Ending index of the current page (exclusive, 0-indexed)

    firstPage: () => void

    Navigate to the first page

    goToPage: (pageNumber: number) => void

    Navigate to a specific page number

    Type declaration

      • (pageNumber: number): void
      • Parameters

        • pageNumber: number

          The page number to navigate to (1-indexed)

        Returns void

    hasFirstPage: boolean

    Whether there is a first page available to navigate to

    hasLastPage: boolean

    Whether there is a last page available to navigate to

    hasNextPage: boolean

    Whether there is a next page available to navigate to

    hasPreviousPage: boolean

    Whether there is a previous page available to navigate to

    isPending: boolean

    Whether a query is currently in progress

    lastPage: () => void

    Navigate to the last page

    nextPage: () => void

    Navigate to the next page

    pageSize: number

    Number of items displayed per page

    previousPage: () => void

    Navigate to the previous page

    startIndex: number

    Starting index of the current page (0-indexed)

    totalPages: number

    Total number of pages available