UNPKG

dino-express

Version:

DinO enabled REST framework based on express

21 lines (20 loc) 580 B
import { type Request } from 'express'; import { type Response } from '../Response'; import { AbstractPolicy } from './AbstractPolicy'; interface Configuration { interval: number; allow: number; } /** * Allows to control the number of requests received by the API in the time * interval */ export declare class RateLimitPolicy extends AbstractPolicy { private configuration; private readonly buckets; constructor(); apply(req: Request): boolean; configure(configuration: Configuration): void; protected onDeny(res: Response): void; } export {};