import { RateLimitConfig } from "../../types/internal"; export default class RateLimit { protected data: RateLimitConfig; /** * Set the Ratelimit Identifier * * This is useful for when you want to make two code seperate rate limit rules act like one, just assign them the * same Identifier and they are interlinked. be wary, this *might* cause issues if the rate limits arent the same * rules. * @default number.generateCrypto(1, 10000000) * @warn ONLY USE IF YOU KNOW WHAT YOU ARE DOING * @since 8.7.2 */ identifier(identifier?: number): Omit, Excluded[number] | 'identifier'>; /** * Set the Penalty when hitting a rate limit in ms * * When the User hits the endpoint(s) more than `` in `ms`, the penalty will be applied to * the user and the user wont be able to access the endpoint for `ms`, after that the users limits are reset * for the endpoint(s). If the User hits the endpoint(s) less than `` in `ms`, the penalty wont be applied * and if `ms` has passed, the limits will reset without any penalty applying. * * You can always prevent a request / message from counting towards the ratelimit by calling `.skipRateLimit()` * @default time(10).s() * @since 8.6.0 */ penalty(ms: number): Omit, Excluded[number] | 'penalty'>; /** * Set the Time Window when hitting an endpoint (/ endpoints) in ms * * When the User hits the endpoint(s) more than `` in `ms`, the penalty will be applied to * the user and the user wont be able to access the endpoint for `ms`, after that the users limits are reset * for the endpoint(s). If the User hits the endpoint(s) less than `` in `ms`, the penalty wont be applied * and if `ms` has passed, the limits will reset without any penalty applying. * * You can always prevent a request / message from counting towards the ratelimit by calling `.skipRateLimit()` * @default time(10).s() * @since 8.6.0 */ window(ms: number): Omit, Excluded[number] | 'window'>; /** * Set the Max Hits in a Time Window * * When the User hits the endpoint(s) more than `` in `ms`, the penalty will be applied to * the user and the user wont be able to access the endpoint for `ms`, after that the users limits are reset * for the endpoint(s). If the User hits the endpoint(s) less than `` in `ms`, the penalty wont be applied * and if `ms` has passed, the limits will reset without any penalty applying. Max Hits being `Infinity` means that the * ratelimit is disabled (if wanting to remove router limit). * * You can always prevent a request / message from counting towards the ratelimit by calling `.skipRateLimit()` * @default Infinity * @since 8.6.0 */ hits(amount: number): Omit, Excluded[number] | 'hits'>; }