UNPKG

express-limiter-pro

Version:

A TypeScript library for safe display and sanitization to prevent XSS attacks.

24 lines (19 loc) 704 B
import { Application } from 'express'; import { EventEmitter } from 'events'; declare function configureRateLimits(app: Application): Promise<void>; interface TokenSecret { accessTokenSecret: string; isDevelopment: boolean; } type ConfigSource = () => Promise<TokenSecret>; declare class ConfigManager extends EventEmitter { private config?; private configSource?; constructor(); setConfigSource(source: ConfigSource): void; setConfig(cfg: TokenSecret): void; getConfig(): TokenSecret | undefined; loadConfig(): Promise<TokenSecret>; } declare const configManager: ConfigManager; export { type ConfigSource, type TokenSecret, configManager, configureRateLimits };