Revert "initial commit"

This reverts commit 2d23eba148.
This commit is contained in:
Alexander Bukhalo
2022-11-20 14:16:17 +03:00
parent 2d23eba148
commit 43816099a6
94 changed files with 17013 additions and 65 deletions

4
lib/interfaces/index.ts Normal file
View File

@@ -0,0 +1,4 @@
export * from './telegraf-options.interface';
export * from './listener-metadata.interface';
export * from './scene-metadata.interface';
export * from './telegraf-exception-filter.interface';

View File

@@ -0,0 +1,4 @@
export interface ListenerMetadata {
method: string;
args: unknown[];
}

View File

@@ -0,0 +1,11 @@
import { SceneOptions } from 'telegraf/typings/scenes/base';
export interface SceneMetadata {
sceneId: string;
type: 'base' | 'wizard';
options?: SceneOptions<any>;
}
export interface WizardStepMetadata {
step: number;
}

View File

@@ -0,0 +1,5 @@
import { ArgumentsHost } from '@nestjs/common';
export interface TelegrafExceptionFilter<T = any> {
catch(exception: T, host: ArgumentsHost): any;
}

View File

@@ -0,0 +1,28 @@
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
import { Middleware, Telegraf } from 'telegraf';
export interface TelegrafModuleOptions {
token: string;
botName?: string;
options?: Partial<Telegraf.Options<any>>;
launchOptions?: Telegraf.LaunchOptions | false;
include?: Function[];
middlewares?: ReadonlyArray<Middleware<any>>;
}
export interface TelegrafOptionsFactory {
createTelegrafOptions():
| Promise<TelegrafModuleOptions>
| TelegrafModuleOptions;
}
export interface TelegrafModuleAsyncOptions
extends Pick<ModuleMetadata, 'imports'> {
botName?: string;
useExisting?: Type<TelegrafOptionsFactory>;
useClass?: Type<TelegrafOptionsFactory>;
useFactory?: (
...args: any[]
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions;
inject?: any[];
}