From 306f239603ef2964aeae6dc653a24d518116239c Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 29 Dec 2020 22:48:19 +0300 Subject: [PATCH] reafctor(): remove unused code & add exports --- lib/helpers/create-update-decorator.helper.ts | 2 +- lib/helpers/index.ts | 1 + lib/index.ts | 2 ++ lib/interfaces/index.ts | 1 + lib/telegraf.constants.ts | 1 - lib/telegraf.providers.ts | 2 +- lib/telegraf.types.ts | 3 --- 7 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 lib/helpers/index.ts diff --git a/lib/helpers/create-update-decorator.helper.ts b/lib/helpers/create-update-decorator.helper.ts index 3db5787..887a552 100644 --- a/lib/helpers/create-update-decorator.helper.ts +++ b/lib/helpers/create-update-decorator.helper.ts @@ -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: Method, diff --git a/lib/helpers/index.ts b/lib/helpers/index.ts new file mode 100644 index 0000000..4a414bd --- /dev/null +++ b/lib/helpers/index.ts @@ -0,0 +1 @@ +export * from './create-update-decorator.helper'; diff --git a/lib/index.ts b/lib/index.ts index a27fc83..da17d36 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,3 +1,5 @@ export * from './decorators'; export * from './interfaces'; +export * from './helpers'; export * from './telegraf.module'; +export * from './telegraf.types'; diff --git a/lib/interfaces/index.ts b/lib/interfaces/index.ts index 23e7d9f..ef12fd5 100644 --- a/lib/interfaces/index.ts +++ b/lib/interfaces/index.ts @@ -1 +1,2 @@ export * from './telegraf-options.interface'; +export * from './listener-metadata.interface'; diff --git a/lib/telegraf.constants.ts b/lib/telegraf.constants.ts index e7ce73e..adb1268 100644 --- a/lib/telegraf.constants.ts +++ b/lib/telegraf.constants.ts @@ -1,4 +1,3 @@ -export const STAGE_MIDDLEWARE = 'StageMiddleware'; export const TELEGRAF_MODULE_OPTIONS = 'TELEGRAF_MODULE_OPTIONS'; export const UPDATE_METADATA = 'UPDATE_METADATA'; diff --git a/lib/telegraf.providers.ts b/lib/telegraf.providers.ts index b7ac54a..7c708c4 100644 --- a/lib/telegraf.providers.ts +++ b/lib/telegraf.providers.ts @@ -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'; diff --git a/lib/telegraf.types.ts b/lib/telegraf.types.ts index fbb6737..6f2d6bb 100644 --- a/lib/telegraf.types.ts +++ b/lib/telegraf.types.ts @@ -16,9 +16,6 @@ export type UpdateMethodArgs = Filter< Parameters[T]>, Middleware >; -// type Test0 = Filter<[['foo', 'bar', 'booz'], ...Middleware[]], Middleware>; -// type Test1 = UpdateMethodArgs<'on'>; -// type Test2 = Parameters['on']>; export type TelegrafOption = ConstructorParameters[1]; export type TelegrafLaunchOption = Parameters[0];