nestjs-telegraf/lib/interfaces/telegraf-options.interface.ts

23 lines
616 B
TypeScript
Raw Normal View History

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 {
createTelegrafOptions(): TelegrafModuleOptions
2020-01-12 01:15:32 +03:00
}
export interface TelegrafModuleAsyncOptions
extends Pick<ModuleMetadata, 'imports'> {
useExisting?: Type<TelegrafOptionsFactory>
2020-01-12 01:15:32 +03:00
useClass?: Type<TelegrafOptionsFactory>
useFactory?: (
...args: any[]
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions
2020-01-12 01:15:32 +03:00
inject?: any[]
}