@takentrade/takentrade-libs
Version:
TakeNTrade shared libraries
20 lines (19 loc) • 752 B
TypeScript
import { NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
import { Observable } from 'rxjs';
/**
* This is intended to intercept incoming requests for routes that intend to use pagination.
* It attaches a `Pagination` object named `pagination` to the request object.
*
* This new `pagination` property on the request body uses the `page` and `limit` properties on
* the request's query object if they exist. If no `page` or `limit` property is provided by
* the request client, this interceptor sets defaults.
*
* Defaults:
*
* `page` = 1 and;
*
* `limit` = 10
*/
export declare class PaginationInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
}