export type Middleware = (value: T) => T | Promise;