feat(wip): upgrade types

This commit is contained in:
unknown 2020-12-25 23:57:17 +03:00
parent 61c6c07482
commit c85460dc10

View File

@ -1,22 +1,26 @@
import { Type } from '@nestjs/common/interfaces/type.interface';
import { Composer, Telegraf } from 'telegraf'; import { Composer, Telegraf } from 'telegraf';
import { Context } from './interfaces'; import { Context } from './interfaces';
export type TelegrafActionTriggers = Parameters<Composer<Context>['action']>[0]; type CtxComposer = Composer<Context>;
export type TelegrafHearsTriggers = Parameters<Composer<Context>['hears']>[0];
export type TelegrafInlineQueryTriggers = Parameters< type ComposerMethodFirstArg<T extends keyof CtxComposer> = Parameters<
Composer<Context>['inlineQuery'] CtxComposer[T]
>[0]; >[0];
export type TelegrafEmail = Parameters<Composer<Context>['email']>[0];
export type TelegrafUrl = Parameters<Composer<Context>['url']>[0]; export type TelegrafActionTriggers = ComposerMethodFirstArg<'action'>;
export type TelegrafTextLink = Parameters<Composer<Context>['textLink']>[0]; export type TelegrafHearsTriggers = ComposerMethodFirstArg<'hears'>;
export type TelegrafTextMention = Parameters< export type TelegrafInlineQueryTriggers = ComposerMethodFirstArg<'inlineQuery'>;
Composer<Context>['textMention'] export type TelegrafEmail = ComposerMethodFirstArg<'email'>;
>[0]; export type TelegrafUrl = ComposerMethodFirstArg<'url'>;
export type TelegrafCashtag = Parameters<Composer<Context>['cashtag']>[0]; export type TelegrafTextLink = ComposerMethodFirstArg<'textLink'>;
export type TelegrafHashtag = Parameters<Composer<Context>['hashtag']>[0]; export type TelegrafTextMention = ComposerMethodFirstArg<'textMention'>;
export type TelegrafCommand = Parameters<Composer<Context>['command']>[0]; export type TelegrafCashtag = ComposerMethodFirstArg<'cashtag'>;
export type TelegrafMention = Parameters<Composer<Context>['mention']>[0]; export type TelegrafHashtag = ComposerMethodFirstArg<'hashtag'>;
export type TelegrafPhone = Parameters<Composer<Context>['phone']>[0]; export type TelegrafCommand = ComposerMethodFirstArg<'command'>;
export type TelegrafUpdateType = Parameters<Composer<Context>['on']>[0]; export type TelegrafMention = ComposerMethodFirstArg<'mention'>;
export type TelegrafOption = ConstructorParameters<typeof Telegraf>[1]; export type TelegrafPhone = ComposerMethodFirstArg<'phone'>;
export type TelegrafUpdateType = ComposerMethodFirstArg<'on'>;
export type TelegrafOption = ConstructorParameters<Type<Telegraf<Context>>>[1];
export type TelegrafLaunchOption = Parameters<Telegraf['launch']>[0]; export type TelegrafLaunchOption = Parameters<Telegraf['launch']>[0];