mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Merge pull request #14126 from EeeasyCode/issue-#14093
fix(common): type narrowing context parameter on createParamDecorator's callback
This commit is contained in:
@@ -16,12 +16,8 @@ export type ParamDecoratorEnhancer = ParameterDecorator;
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function createParamDecorator<
|
||||
FactoryData = any,
|
||||
FactoryInput = any,
|
||||
FactoryOutput = any,
|
||||
>(
|
||||
factory: CustomParamFactory<FactoryData, FactoryInput, FactoryOutput>,
|
||||
export function createParamDecorator<FactoryData = any, FactoryOutput = any>(
|
||||
factory: CustomParamFactory<FactoryData, FactoryOutput>,
|
||||
enhancers: ParamDecoratorEnhancer[] = [],
|
||||
): (
|
||||
...dataOrPipes: (Type<PipeTransform> | PipeTransform | FactoryData)[]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { ExecutionContext } from './execution-context.interface';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export type CustomParamFactory<TData = any, TInput = any, TOutput = any> = (
|
||||
export type CustomParamFactory<TData = any, TOutput = any> = (
|
||||
data: TData,
|
||||
input: TInput,
|
||||
context: ExecutionContext,
|
||||
) => TOutput;
|
||||
|
||||
Reference in New Issue
Block a user