mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-27 08:18:08 +03:00
30 lines
757 B
TypeScript
30 lines
757 B
TypeScript
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
|
import {
|
|
TelegrafOptions,
|
|
LaunchPollingOptions,
|
|
LaunchWebhookOptions,
|
|
} from 'telegraf/typings/telegraf';
|
|
|
|
export interface TelegrafModuleOptions {
|
|
token: string;
|
|
options?: TelegrafOptions;
|
|
launchOptions?: {
|
|
polling?: LaunchPollingOptions;
|
|
webhook?: LaunchWebhookOptions;
|
|
};
|
|
}
|
|
|
|
export interface TelegrafOptionsFactory {
|
|
createTelegrafOptions(): TelegrafModuleOptions;
|
|
}
|
|
|
|
export interface TelegrafModuleAsyncOptions
|
|
extends Pick<ModuleMetadata, 'imports'> {
|
|
useExisting?: Type<TelegrafOptionsFactory>;
|
|
useClass?: Type<TelegrafOptionsFactory>;
|
|
useFactory?: (
|
|
...args: any[]
|
|
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions;
|
|
inject?: any[];
|
|
}
|