refactor(types): use exported options types (#232)

This commit is contained in:
Morbo 2021-01-23 19:51:29 +03:00 committed by GitHub
parent 0c50fca66e
commit 0b8819665a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -1,12 +1,11 @@
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
import { Middleware } from 'telegraf';
import { LaunchOptions, TelegrafOptions } from '../types';
import { Middleware, Telegraf } from 'telegraf';
export interface TelegrafModuleOptions {
token: string;
botName?: string;
options?: TelegrafOptions;
launchOptions?: LaunchOptions;
options?: Telegraf.Options<any>;
launchOptions?: Telegraf.LaunchOptions;
include?: Function[];
middlewares?: ReadonlyArray<Middleware<any>>;
}

View File

@ -16,6 +16,3 @@ export type ComposerMethodArgs<
T extends Composer<never>,
U extends OnlyFunctionPropertyNames<T> = OnlyFunctionPropertyNames<T>
> = Filter<Parameters<T[U]>, Middleware<never>>;
export type LaunchOptions = Parameters<Telegraf['launch']>[0];
export type TelegrafOptions = ConstructorParameters<typeof Telegraf>[1];