From e8dfcf170f3e490bfddebbb5806155d7fa861677 Mon Sep 17 00:00:00 2001 From: "Angel S. Moreno" Date: Mon, 15 Apr 2024 13:07:32 -0400 Subject: [PATCH] feat: enhanced typing for CurrentUserChecker by introducing generics (#1375) --- src/CurrentUserChecker.ts | 2 +- src/index.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CurrentUserChecker.ts b/src/CurrentUserChecker.ts index bf0cf2d1..63b79ec8 100644 --- a/src/CurrentUserChecker.ts +++ b/src/CurrentUserChecker.ts @@ -3,4 +3,4 @@ import { Action } from './Action'; /** * Special function used to get currently authorized user. */ -export type CurrentUserChecker = (action: Action) => Promise | any; +export type CurrentUserChecker = (action: Action) => Promise | User | null; diff --git a/src/index.ts b/src/index.ts index a4c0c8cf..06549c2b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -89,6 +89,8 @@ export * from './CustomParameterDecorator'; export * from './RoleChecker'; export * from './Action'; export * from './InterceptorInterface'; +export * from './CurrentUserChecker'; +export * from './AuthorizationChecker'; export * from './driver/BaseDriver'; export * from './driver/express/ExpressDriver';