UNPKG

@universis/janitor

Version:

Universis api plugin for handling user authorization and rate limiting

22 lines (19 loc) 916 B
import { ApplicationBase, ApplicationService } from '@themost/common'; import { Application, Router } from 'express'; import { BehaviorSubject } from 'rxjs'; import { Options as SpeedLimitProfile, Store } from 'express-slow-down'; export declare type SpeedLimitStoreConstructor = new (...arg: unknown[]) => Store; export declare interface SpeedLimitServiceConfiguration { extends?: string; storeType?: string; profiles?: Map<string, SpeedLimitProfile>; paths?: Map<string, ({ profile: string } | SpeedLimitProfile)>; } export declare class SpeedLimitService extends ApplicationService { constructor(app: ApplicationBase); getServiceContainer(): BehaviorSubject<Router | Application>; getServiceName(): string; getServiceConfiguration(): SpeedLimitServiceConfiguration; set(path: string, options: { profile?: string } | SpeedLimitProfile): this; unset(path: string): this; }