BREAKING CHANGE(core): major architectural refactoring with fetch-like API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type IExtendedIncomingMessage } from '../../legacy/smartrequest.request.js';
|
||||
import { type SmartResponse } from '../../core/index.js';
|
||||
|
||||
/**
|
||||
* Pagination strategy options
|
||||
@@ -45,8 +45,8 @@ export interface LinkPaginationConfig {
|
||||
*/
|
||||
export interface CustomPaginationConfig {
|
||||
strategy: PaginationStrategy.CUSTOM;
|
||||
hasNextPage: (response: IExtendedIncomingMessage<any>) => boolean;
|
||||
getNextPageParams: (response: IExtendedIncomingMessage<any>, currentParams: Record<string, string>) => Record<string, string>;
|
||||
hasNextPage: (response: SmartResponse<any>) => boolean;
|
||||
getNextPageParams: (response: SmartResponse<any>, currentParams: Record<string, string>) => Record<string, string>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,5 +62,5 @@ export interface TPaginatedResponse<T> {
|
||||
hasNextPage: boolean; // Whether there are more pages
|
||||
getNextPage: () => Promise<TPaginatedResponse<T>>; // Function to get the next page
|
||||
getAllPages: () => Promise<T[]>; // Function to get all remaining pages and combine
|
||||
response: IExtendedIncomingMessage<any>; // Original response
|
||||
response: SmartResponse<any>; // Original response
|
||||
}
|
Reference in New Issue
Block a user