Skip to content

Commit 265f301

Browse files
Merge pull request #94 from uniocjs/dev-groupguanfang
refactor: typing for inject decorator
2 parents 0b6e154 + de17635 commit 265f301

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/fifty-falcons-lick.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@unioc/core": patch
3+
---
4+
5+
refactor(core): inject decorator

packages/core/core/src/decorators/inject.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ export interface IInjectMetadata {
1616
*
1717
* @environment stage3
1818
*/
19-
export function Inject(target: undefined, context: ClassFieldDecoratorContext): any
19+
export function Inject<TClassShape extends Record<any, any>, TValue>(target: undefined, context: ClassFieldDecoratorContext<TClassShape, TValue>): any
2020
/**
2121
* ### Inject
2222
*
2323
* 💉 Inject a dependency into a property.
2424
*
2525
* @environment legacy
2626
*/
27-
export function Inject<TClassShape extends Record<any, any>>(target: TClassShape, propertyKey: string | symbol): any
27+
export function Inject<TClassShape extends Record<any, any>, TPropertyKey extends PropertyKey>(target: TClassShape, propertyKey: TPropertyKey): any
2828
/**
2929
* ### Inject
3030
*

0 commit comments

Comments
 (0)