UNPKG

hono-rate-limiter

Version:
11 lines (10 loc) 731 B
import type { Context } from "hono"; import type { Env, Input } from "hono/types"; import type { ConfigType, Promisify, Store } from "./types"; export declare const isValidStore: <E extends Env = Env, P extends string = string, I extends Input = Input>(value: Store<E, P, I>) => value is Store<E, P, I>; export declare function initStore<E extends Env, P extends string, I extends Input>(store: Store<E, P, I>, options: ConfigType<E, P, I>): void; export declare function getKeyAndIncrement<E extends Env, P extends string, I extends Input>(c: Context<E, P, I>, keyGenerator: (c: Context<E, P, I>) => Promisify<string>, store: Store<E, P, I>): Promise<{ key: string; totalHits: number; resetTime: Date | undefined; }>;