import { MaybeAsync, Message, TelegramClient } from '@mtcute/client' import { tl } from '@mtcute/tl' import { PropagationSymbol } from './propagation' interface BaseUpdateHandler { type: Type callback: Handler check?: Checker } type ParsedUpdateHandler = BaseUpdateHandler< Type, ( update: Update, client: TelegramClient ) => MaybeAsync, (update: Update, client: TelegramClient) => MaybeAsync > export type RawUpdateHandler = BaseUpdateHandler< 'raw', ( client: TelegramClient, update: tl.TypeUpdate, users: Record, chats: Record ) => MaybeAsync, ( client: TelegramClient, update: tl.TypeUpdate, users: Record, chats: Record ) => MaybeAsync > export type NewMessageHandler = ParsedUpdateHandler<'new_message', T> export type UpdateHandler = RawUpdateHandler | NewMessageHandler