
* refactor: consolidate registration decorators - Introduced `Register` decorator to handle class and instance registration in the DI container. - Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration. - Added support for marking dependencies as deprecated with a warning logged upon first resolution. - Updated documentation with examples and notes on deprecation. * tests: add mode parameter to RegisterInstanceDecorator - Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes. - Updated test cases to utilize the new `mode` parameter when registering an instance. - Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings. - Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode. * docs: Reflect changes to changelog * refactor: add region tags for overloads in Register.ts * docs: Reflect changes to changelog * refactor: consolidate registration decorators - Introduced `Register` decorator to handle class and instance registration in the DI container. - Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration. - Added support for marking dependencies as deprecated with a warning logged upon first resolution. - Updated documentation with examples and notes on deprecation. * tests: add mode parameter to RegisterInstanceDecorator - Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes. - Updated test cases to utilize the new `mode` parameter when registering an instance. - Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings. - Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode. * docs: Reflect changes to changelog * refactor: add region tags for overloads in Register.ts * docs: Reflect changes to changelog * docs: Reflect changes to changelog und push version
19 lines
595 B
TypeScript
19 lines
595 B
TypeScript
/* eslint-disable deprecation/deprecation */
|
|
import { TSinjex } from 'src/classes/TSinjex';
|
|
import { Inject } from 'src/decorators/Inject';
|
|
import { Register } from 'src/decorators/Register';
|
|
import { RegisterInstance } from 'src/decorators/RegisterInstance';
|
|
import {
|
|
test_InjectDecorator,
|
|
test_RegisterDecorator,
|
|
test_RegisterInstanceDecorator,
|
|
} from './Decorators.spec';
|
|
|
|
test_InjectDecorator(TSinjex, Inject);
|
|
|
|
test_RegisterDecorator(TSinjex, Register);
|
|
|
|
test_RegisterInstanceDecorator(TSinjex, RegisterInstance);
|
|
|
|
test_RegisterInstanceDecorator(TSinjex, Register, 'instance');
|