Skip to content

Commit f1d5520

Browse files
committed
refactor(common): included auto infer types for custom decorators
1 parent 9344cc6 commit f1d5520

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/common/decorators/http/create-route-param-metadata.decorator.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ export type ParamDecoratorEnhancer = ParameterDecorator;
3333
*
3434
* @param factory
3535
*/
36-
export function createParamDecorator<T = any>(
37-
factory: CustomParamFactory,
36+
export function createParamDecorator<
37+
FactoryData = any,
38+
FactoryInput = any,
39+
FactoryOutput = any
40+
>(
41+
factory: CustomParamFactory<FactoryData, FactoryInput, FactoryOutput>,
3842
enhancers: ParamDecoratorEnhancer[] = [],
3943
): (
40-
...dataOrPipes: (Type<PipeTransform> | PipeTransform | T)[]
44+
...dataOrPipes: (Type<PipeTransform> | PipeTransform | FactoryInput)[]
4145
) => ParameterDecorator {
4246
const paramtype = uuid();
4347
return (
4448
data?,
45-
...pipes: (Type<PipeTransform> | PipeTransform | T)[]
49+
...pipes: (Type<PipeTransform> | PipeTransform | FactoryInput)[]
4650
): ParameterDecorator => (target, key, index) => {
4751
const args =
4852
Reflect.getMetadata(ROUTE_ARGS_METADATA, target.constructor, key) || {};

0 commit comments

Comments
 (0)