/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { IThrottler, ILogger } from "@fluidframework/server-services-core"; import { RequestHandler, Request } from "express"; /** * @internal */ export interface IThrottleMiddlewareOptions { /** * Relative weight of request amongst other requests with same suffix. */ weight: number; /** * Distinguishes throttle id amongst other tracked ids with same suffix. * For example, this could be a tenantId, clientId, or endpoint name. * * Can be a function that takes in the `express.Request` and returns the prefix as a string, * which is useful for getting the id prefix from route params, such as `tenantId`. */ throttleIdPrefix?: string | ((req: Request) => string); /** * Distinguishes throttle id amongst other tracked ids with same prefix. * For example, this could be "HistorianRest", "AlfredRest", "OpenSocketConn", or "SubmitOp". */ throttleIdSuffix?: string; } /** * Express middleware for API throttling. * @internal */ export declare function throttle(throttler?: IThrottler, logger?: ILogger, options?: Partial, isHttpUsageCountingEnabled?: boolean): RequestHandler; //# sourceMappingURL=throttlerMiddleware.d.ts.map