feat(decorators): metadata typings added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 18:20:07 +03:00
parent dd59da7737
commit 25710b7908
13 changed files with 162 additions and 34 deletions

View File

@@ -1,12 +1,18 @@
import { SetMetadata } from '@nestjs/common';
import { DECORATORS } from '../telegraf.constants';
export type TelegrafPhonePhone = string | string[];
export interface TelegrafPhoneMetadata {
phone: TelegrafPhonePhone;
}
/**
* Phone number handling.
* @param phone Phone number
*
* https://telegraf.js.org/#/?id=phone
*/
export function TelegrafPhone(phone: string | string[]): MethodDecorator {
export function TelegrafPhone(phone: TelegrafPhonePhone): MethodDecorator {
return SetMetadata(DECORATORS.PHONE, { phone });
}