1 | import { type ResolverData } from "./resolver-data.js";
|
2 | export type NextFn = () => Promise<any>;
|
3 | export type MiddlewareFn<TContext extends object = object> = (action: ResolverData<TContext>, next: NextFn) => Promise<any>;
|
4 | export interface MiddlewareInterface<TContext extends object = object> {
|
5 | use: MiddlewareFn<TContext>;
|
6 | }
|
7 | export type MiddlewareClass<TContext extends object = object> = new (...args: any[]) => MiddlewareInterface<TContext>;
|
8 | export type Middleware<TContext extends object = object> = MiddlewareFn<TContext> | MiddlewareClass<TContext>;
|