mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 15:34:38 +03:00
fix(boot): update config interface
This commit is contained in:
parent
13fe9b03c6
commit
f88e34d489
@ -1,11 +1,18 @@
|
|||||||
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
||||||
import { Middleware, Context } from 'telegraf';
|
import { Middleware, Context } from 'telegraf';
|
||||||
import { TelegrafLaunchOption, TelegrafOption } from '../telegraf.types';
|
import {
|
||||||
|
LaunchPollingOptions,
|
||||||
|
LaunchWebhookOptions,
|
||||||
|
TelegrafOptions,
|
||||||
|
} from 'telegraf/typings/telegraf';
|
||||||
|
|
||||||
export interface TelegrafModuleOptions<C extends Context = Context> {
|
export interface TelegrafModuleOptions<C extends Context = Context> {
|
||||||
token: string;
|
token: string;
|
||||||
options?: TelegrafOption;
|
options?: TelegrafOptions;
|
||||||
launchOptions?: TelegrafLaunchOption;
|
launchOptions?: {
|
||||||
|
polling?: LaunchPollingOptions;
|
||||||
|
webhook?: LaunchWebhookOptions;
|
||||||
|
};
|
||||||
middlewares?: Middleware<C>[];
|
middlewares?: Middleware<C>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Composer, Middleware, BaseScene, Telegraf } from 'telegraf';
|
import { BaseScene, Composer, Middleware } from 'telegraf';
|
||||||
|
|
||||||
export type Filter<T extends any[], F> = T extends []
|
export type Filter<T extends any[], F> = T extends []
|
||||||
? []
|
? []
|
||||||
@ -19,6 +19,3 @@ export type ComposerMethodArgs<
|
|||||||
|
|
||||||
export type UpdateMethods = OnlyFunctionPropertyNames<Composer<never>>;
|
export type UpdateMethods = OnlyFunctionPropertyNames<Composer<never>>;
|
||||||
export type SceneMethods = OnlyFunctionPropertyNames<BaseScene<never>>;
|
export type SceneMethods = OnlyFunctionPropertyNames<BaseScene<never>>;
|
||||||
|
|
||||||
export type TelegrafOption = ConstructorParameters<typeof Telegraf>[1];
|
|
||||||
export type TelegrafLaunchOption = Parameters<Telegraf<never>['launch']>[0];
|
|
||||||
|
Loading…
Reference in New Issue
Block a user