import type { Filter } from '@puregram/api'; import type { Middleware } from '../dispatch/hooks.js'; /** * gate a middleware on a filter — runs it on match, calls `next()` otherwise. * uses the filter's `kinds` metadata for the same fast-path as `tg.on(filter, …)`. * the middleware sees the narrowed update type * * @example * ```ts * tg.useHook('onUpdate', when(f.chat.private, async (u, next) => { * console.log('[private]', u.kind) * await next() * }), { priority: 'high' }) * ``` */ export declare function when(filter: Filter, mw: Middleware): Middleware; //# sourceMappingURL=when.d.ts.map