import type { MaybePromise } from 'elysia' import type { Options } from './Options' export interface Context { // class initialization for creating context init(options: Omit): void // function will be called to count request increment(key: string): MaybePromise<{ count: number nextReset: Date }> // function will be called to deduct count in case of request failure decrement(key: string): MaybePromise // if key specified, it will reset count for only specific user, otherwise clear entire storage reset(key?: string): MaybePromise // cleanup function on process killed kill(): MaybePromise }