import { SetMetadata } from '@nestjs/common';

export const THROTTLE_META_KEY = 'throttle_meta_key';

export type ThrottleMeta = {
  limit: number;
  windowMs: number;
};

export const Throttle = (limit: number, windowMs: number) =>
  SetMetadata(THROTTLE_META_KEY, { limit, windowMs } satisfies ThrottleMeta);
