2020-01-12 01:15:32 +03:00
|
|
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
|
2020-02-29 12:38:14 +03:00
|
|
|
import { TelegrafOptions } from 'telegraf'
|
2020-01-12 01:15:32 +03:00
|
|
|
|
|
|
|
export interface TelegrafModuleOptions {
|
|
|
|
token: string
|
|
|
|
sitePublicUrl?: string
|
2020-02-29 12:38:14 +03:00
|
|
|
telegrafOptions?: TelegrafOptions
|
2020-01-12 01:15:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TelegrafOptionsFactory {
|
2020-01-12 01:36:53 +03:00
|
|
|
createTelegrafOptions(): TelegrafModuleOptions
|
2020-01-12 01:15:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TelegrafModuleAsyncOptions
|
|
|
|
extends Pick<ModuleMetadata, 'imports'> {
|
2020-01-12 01:36:53 +03:00
|
|
|
useExisting?: Type<TelegrafOptionsFactory>
|
2020-01-12 01:15:32 +03:00
|
|
|
useClass?: Type<TelegrafOptionsFactory>
|
2020-01-12 01:36:53 +03:00
|
|
|
useFactory?: (
|
|
|
|
...args: any[]
|
|
|
|
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions
|
2020-01-12 01:15:32 +03:00
|
|
|
inject?: any[]
|
|
|
|
}
|