import { Composer, Middleware, BaseScene, Telegraf } from 'telegraf'; export type Filter = T extends [] ? [] : T extends [infer Head, ...infer Tail] ? Head extends F ? Filter : [Head, ...Filter] : []; export type OnlyFunctionPropertyNames = { [K in keyof T]: T[K] extends (...args: any) => any ? K : never; }[keyof T]; // export type FilterComposerMethods = Exclude< // T, // 'middleware' | 'guard' | 'filter' | 'drop' // >; export type ComposerMethodArgs< T extends Composer, U extends OnlyFunctionPropertyNames = OnlyFunctionPropertyNames > = Filter, Middleware>; export type UpdateMethods = OnlyFunctionPropertyNames>; export type SceneMethods = OnlyFunctionPropertyNames>; export type TelegrafOption = ConstructorParameters[1]; export type TelegrafLaunchOption = Parameters[0];