Skip to content

Commit

Permalink
feat: enhanced typing for CurrentUserChecker by introducing generics (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
angelxmoreno committed Apr 15, 2024
1 parent 9c30c5e commit e8dfcf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CurrentUserChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { Action } from './Action';
/**
* Special function used to get currently authorized user.
*/
export type CurrentUserChecker = (action: Action) => Promise<any> | any;
export type CurrentUserChecker = <User = any>(action: Action) => Promise<User | null> | User | null;
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e8dfcf1

Please sign in to comment.