reafctor(): remove unused code & add exports

This commit is contained in:
Arthur 2020-12-29 22:48:19 +03:00
parent 8c72790226
commit 306f239603
7 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { SetMetadata } from '@nestjs/common';
import { UpdateMethodArgs, UpdateMethods } from '../telegraf.types';
import { UPDATE_LISTENER_METADATA } from '../telegraf.constants';
import { ListenerMetadata } from '../interfaces/listener-metadata.interface';
import { ListenerMetadata } from '../interfaces';
export function createUpdateDecorator<Method extends UpdateMethods>(
method: Method,

1
lib/helpers/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './create-update-decorator.helper';

View File

@ -1,3 +1,5 @@
export * from './decorators';
export * from './interfaces';
export * from './helpers';
export * from './telegraf.module';
export * from './telegraf.types';

View File

@ -1 +1,2 @@
export * from './telegraf-options.interface';
export * from './listener-metadata.interface';

View File

@ -1,4 +1,3 @@
export const STAGE_MIDDLEWARE = 'StageMiddleware';
export const TELEGRAF_MODULE_OPTIONS = 'TELEGRAF_MODULE_OPTIONS';
export const UPDATE_METADATA = 'UPDATE_METADATA';

View File

@ -1,5 +1,5 @@
import { Provider } from '@nestjs/common';
import { session, Telegraf } from 'telegraf';
import { Telegraf } from 'telegraf';
import { TELEGRAF_MODULE_OPTIONS } from './telegraf.constants';
import { TelegrafModuleOptions } from './interfaces';

View File

@ -16,9 +16,6 @@ export type UpdateMethodArgs<T extends UpdateMethods> = Filter<
Parameters<Composer<never>[T]>,
Middleware<any>
>;
// type Test0 = Filter<[['foo', 'bar', 'booz'], ...Middleware<any>[]], Middleware<any>>;
// type Test1 = UpdateMethodArgs<'on'>;
// type Test2 = Parameters<Composer<never>['on']>;
export type TelegrafOption = ConstructorParameters<typeof Telegraf>[1];
export type TelegrafLaunchOption = Parameters<Telegraf['launch']>[0];