nestjs-telegraf/lib/interfaces/telegraf-options.interface.ts
2020-02-29 12:38:14 +03:00

23 lines
616 B
TypeScript

import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
import { TelegrafOptions } from 'telegraf'
export interface TelegrafModuleOptions {
token: string
sitePublicUrl?: string
telegrafOptions?: TelegrafOptions
}
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[]
}