UNPKG

nestjs-aborter

Version:

Automatic request cancellation and timeout handling for NestJS applications

31 lines (30 loc) 1.27 kB
import { DynamicModule, Type, ForwardReference } from '@nestjs/common'; import type { AborterOptions } from './interfaces/aborter.interface'; import type { InjectionToken, OptionalFactoryDependency } from '@nestjs/common'; /** * Global module for configuring the Aborter interceptor. * * Import this module in your root AppModule to enable * automatic request cancellation and timeout handling. */ export declare class AborterModule { /** * Configure the module with static options. * * @param options - Configuration options for the Aborter interceptor * @returns Dynamic module configuration */ static forRoot(options?: AborterOptions): DynamicModule; /** * Configure the module asynchronously with a factory function. * Useful for loading configuration from ConfigService or other providers. * * @param options - Async configuration options * @returns Dynamic module configuration */ static forRootAsync(options: { useFactory: (...args: unknown[]) => Promise<AborterOptions> | AborterOptions; inject?: Array<InjectionToken | OptionalFactoryDependency>; imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>; }): DynamicModule; }