diff --git a/src/ts/@loafer/context/decorator/App.ts b/src/ts/@loafer/context/decorator/App.ts index f126ca5..c864835 100644 --- a/src/ts/@loafer/context/decorator/App.ts +++ b/src/ts/@loafer/context/decorator/App.ts @@ -1,28 +1,30 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import ConfigurationDefinition from '@loafer/context/definition/ConfigurationDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -import GetAppContext from '@loafer/context'; -import { InjectableSterotype } from '@loafer/pouches/constants'; -import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -import PouchDefinitionRegistry from '@loafer/pouches/factory/registry/PouchDefinitionRegistry'; -import { validateQualifier } from '@loafer/pouches/util/qualifier'; +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; -const App = (qualifier?: string | symbol ) => createDecorator('App', { - classDecorator: (target: TFunction): TFunction | void => { - let configurationDefinition = getInjectableDefinition(target.prototype, ConfigurationDefinition, false); - if (undefined !== configurationDefinition) { - throw new Error('Cannot apply @Injectable or @Injectable stereotype decorator multiple times.'); - } +import { + Class, +} from '@loafer/core/reflect'; - configurationDefinition = getInjectableDefinition(target.prototype, ConfigurationDefinition, true); - configurationDefinition.Stereotype = InjectableSterotype.APP; - configurationDefinition.Qualifier = validateQualifier(target.prototype, qualifier); +import { + InjectableAnnotation, +} from '@loafer/pouches/decorator/Injectable'; - return target; - }, +export class AppAnnotation extends InjectableAnnotation implements DecoratorHandler { + public constructor(qualifier?: PropertyType) { + super(qualifier); + } + public onClassDecorator = (clazz: Class, target: TFunction): TFunction | void => { + console.log('App'); + } -}); +} +export const App = Decorator.create(AppAnnotation); export default App; diff --git a/src/ts/@loafer/context/decorator/Configuration.ts b/src/ts/@loafer/context/decorator/Configuration.ts index 684b7bb..a621278 100644 --- a/src/ts/@loafer/context/decorator/Configuration.ts +++ b/src/ts/@loafer/context/decorator/Configuration.ts @@ -1,28 +1,30 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import ConfigurationDefinition from '@loafer/context/definition/ConfigurationDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -import GetAppContext from '@loafer/context'; -import { InjectableSterotype } from '@loafer/pouches/constants'; -import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -import PouchDefinitionRegistry from '@loafer/pouches/factory/registry/PouchDefinitionRegistry'; -import { validateQualifier } from '@loafer/pouches/util/qualifier'; +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; -const Configuration = (qualifier?: string | symbol ) => createDecorator('Configuration', { - classDecorator: (target: TFunction): TFunction | void => { - let configurationDefinition: ConfigurationDefinition = getInjectableDefinition(target.prototype, ConfigurationDefinition, false); - if (undefined !== configurationDefinition) { - throw new Error('Cannot apply @Injectable or @Injectable stereotype decorator multiple times.'); - } +import { + Class, +} from '@loafer/core/reflect'; - configurationDefinition = getInjectableDefinition(target.prototype, ConfigurationDefinition, true); - configurationDefinition.Stereotype = InjectableSterotype.CONFIGURATION; - configurationDefinition.Qualifier = validateQualifier(target.prototype, qualifier); +import { + InjectableAnnotation, +} from '@loafer/pouches/decorator/Injectable'; - return target; - }, +export class ConfigurationAnnotation extends InjectableAnnotation implements DecoratorHandler { + public constructor(qualifier?: PropertyType) { + super(qualifier); + } + public onClassDecorator = (clazz: Class, target: TFunction): TFunction | void => { + console.log('Configuration'); + } -}); +} +export const Configuration = Decorator.create(ConfigurationAnnotation); export default Configuration; diff --git a/src/ts/@loafer/context/decorator/Pouch.ts b/src/ts/@loafer/context/decorator/Pouch.ts index a116c6f..e14a765 100644 --- a/src/ts/@loafer/context/decorator/Pouch.ts +++ b/src/ts/@loafer/context/decorator/Pouch.ts @@ -1,20 +1,36 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; +import { + ClassType, + PropertyType, +} from '@loafer/core/constants/types'; -import ConfigurationDefinition from '@loafer/context/definition/ConfigurationDefinition'; -import PouchConfig from '@loafer/context/decorator/PouchConfig'; +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; -import { InjectableSterotype } from '@loafer/pouches/constants'; +import { + Class, +} from '@loafer/core/reflect'; -const Pouch = (pouchConfig: PouchConfig = {}) => createDecorator('Pouch', { - methodDecorator: (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor => { - let configurationDefinition: ConfigurationDefinition = getInjectableDefinition(target, ConfigurationDefinition, false); - if (undefined === configurationDefinition || InjectableSterotype.CONFIGURATION !== configurationDefinition.Stereotype) { - throw new Error('Cannot apply @Pouch decorator on not @Configuration class.'); - } - configurationDefinition.addPouch(propertyKey, pouchConfig); - return descriptor; - }, -}); +export interface PouchConfig { + qualifier?: PropertyType; + type?: ClassType; +} + +export class PouchAnnotation implements DecoratorHandler { + private readonly Qualifier: PropertyType; + private readonly Type: ClassType; + public constructor(config: PouchConfig = {}) { + this.Qualifier = config.qualifier; + this.Type = config.type; + } + + public onMethodDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, + descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void => { + console.log('Pouch'); + } +} + +export const Pouch = Decorator.create(PouchAnnotation); export default Pouch; diff --git a/src/ts/@loafer/context/decorator/PouchConfig.ts b/src/ts/@loafer/context/decorator/PouchConfig.ts deleted file mode 100644 index d9fbf72..0000000 --- a/src/ts/@loafer/context/decorator/PouchConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ClassType, PropertyType } from '@loafer/core/constants'; - -interface PouchConfig { - qualifier?: PropertyType; - type?: ClassType; -} - -export default PouchConfig; diff --git a/src/ts/@loafer/context/decorator/Service.ts b/src/ts/@loafer/context/decorator/Service.ts deleted file mode 100644 index bd39cb6..0000000 --- a/src/ts/@loafer/context/decorator/Service.ts +++ /dev/null @@ -1,28 +0,0 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; - -import GetAppContext from '@loafer/context'; -import { InjectableSterotype } from '@loafer/pouches/constants'; -import { validateQualifier } from '@loafer/pouches/util/qualifier'; -import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -import PouchDefinitionRegistry from '@loafer/pouches/factory/registry/PouchDefinitionRegistry'; - -const Service = (qualifier?: string | symbol ) => createDecorator('Service', { - classDecorator: (target: TFunction): TFunction | void => { - let injectableDefinition: InjectableDefinition = getInjectableDefinition(target.prototype, InjectableDefinition, false); - if (undefined !== injectableDefinition) { - throw new Error('Cannot apply @Injectable or @Injectable stereotype decorator multiple times.'); - } - - injectableDefinition = getInjectableDefinition(target.prototype, InjectableDefinition, true); - injectableDefinition.Stereotype = InjectableSterotype.SERVICE; - injectableDefinition.Qualifier = validateQualifier(target.prototype, qualifier); - - return target; - }, - -}); - - -export default Service; diff --git a/src/ts/@loafer/context/index.ts b/src/ts/@loafer/context/index.ts deleted file mode 100644 index 4d6cdd8..0000000 --- a/src/ts/@loafer/context/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import AppContext from '@loafer/context/AppContext'; -import DefaultAppContext from '@loafer/context/implement/DefaultAppContext'; - -let _appContext: AppContext = undefined; - -const GetAppContext = (): AppContext => { - if (undefined === _appContext) { - _appContext = new DefaultAppContext(); - } - return _appContext; -}; - -export default GetAppContext; diff --git a/src/ts/@loafer/context/util/metadata/index.ts b/src/ts/@loafer/context/util/metadata/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@loafer/core/decorator/Decorator.ts b/src/ts/@loafer/core/decorator/Decorator.ts index 20de349..e97ea06 100644 --- a/src/ts/@loafer/core/decorator/Decorator.ts +++ b/src/ts/@loafer/core/decorator/Decorator.ts @@ -21,20 +21,21 @@ export class Decorator { reflection = new Reflection(type); Reflect.defineMetadata(ReflectConstants.REFLECT_META, reflection, type); } + let clazz: Class = reflection.getClass(); switch(decoratorType) { case DecoratorType.CLASS: reflection.addClassAnnotation(annotation); - return annotation.onClassDecorator.apply(annotation, decoratorArgs); + return annotation.onClassDecorator.call(annotation, clazz, decoratorArgs[0]); case DecoratorType.PROPERTY: reflection.addPropertyAnnotation(annotation, decoratorArgs[1]); - return annotation.onPropertyDecorator.apply(annotation, decoratorArgs); + return annotation.onPropertyDecorator.call(annotation, clazz, decoratorArgs[0], decoratorArgs[1]); case DecoratorType.METHOD: reflection.addMethodAnnotation(annotation, decoratorArgs[1]); - return annotation.onMethodDecorator.apply(annotation, decoratorArgs); + return annotation.onMethodDecorator.call(annotation, clazz, decoratorArgs[0], decoratorArgs[1], decoratorArgs[2]); case DecoratorType.PARAMETER: reflection.addParameterAnnotation(annotation, decoratorArgs[1], decoratorArgs[2]); - return annotation.onParameterDecorator.apply(annotation, decoratorArgs); + return annotation.onParameterDecorator.call(annotation, clazz, decoratorArgs[0], decoratorArgs[1], decoratorArgs[2]); default: } }; diff --git a/src/ts/@loafer/core/decorator/DecoratorHandler.ts b/src/ts/@loafer/core/decorator/DecoratorHandler.ts index c56f8f4..096eac6 100644 --- a/src/ts/@loafer/core/decorator/DecoratorHandler.ts +++ b/src/ts/@loafer/core/decorator/DecoratorHandler.ts @@ -1,9 +1,18 @@ +import { + ClassType, + PropertyType, +} from '@loafer/core/constants/types'; + +import { + Class, +} from '@loafer/core/reflect'; + export interface DecoratorHandler { - onClassDecorator?: (target: TFunction) => TFunction | void; - onPropertyDecorator?: (target: Object, propertyKey: string | symbol) => void; - onMethodDecorator?: (target: Object, propertyKey: string | symbol, + onClassDecorator?: (clazz: Class, target: TFunction) => TFunction | void; + onPropertyDecorator?: (clazz: Class, target: Object, propertyKey: PropertyType) => void; + onMethodDecorator?: (clazz: Class, target: Object, propertyKey: PropertyType, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; - onParameterDecorator?: (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; + onParameterDecorator?: (clazz: Class, target: Object, propertyKey: PropertyType, parameterIndex: number) => void; } export default DecoratorHandler; diff --git a/src/ts/@loafer/pouches/decorator/Inject.ts b/src/ts/@loafer/pouches/decorator/Inject.ts index b73aeb4..7220265 100644 --- a/src/ts/@loafer/pouches/decorator/Inject.ts +++ b/src/ts/@loafer/pouches/decorator/Inject.ts @@ -1,25 +1,47 @@ -import InjectConfig from '@loafer/pouches/decorator/InjectConfig'; -import InjectDefinition from '@loafer/pouches/definition/InjectDefinition'; -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import { getInjectDefinition } from '@loafer/pouches/util/metadata'; import { ClassType, - DESIGN_TYPE, PropertyType, -} from '@loafer/core/constants'; -const Inject = (injectConfig: InjectConfig = {}) => createDecorator('Inject', { - propertyDecorator: (target: Object, propertyKey: string | symbol): void => { - let injectDefinition: InjectDefinition = getInjectDefinition(target, InjectDefinition, true); - injectDefinition.addInject(injectConfig, propertyKey); - }, - parameterDecorator: (target: Object, propertyKey: string | symbol, parameterIndex: number): void => { - let injectDefinition: InjectDefinition = getInjectDefinition(target, InjectDefinition, true); - injectDefinition.addInject(injectConfig, propertyKey, parameterIndex); - }, +} from '@loafer/core/constants/types'; -}); +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; + +import { + Class, +} from '@loafer/core/reflect'; + +export interface InjectConfig { + qualifier?: PropertyType; + required?: boolean; + type?: ClassType; +} + +export class InjectAnnotation implements DecoratorHandler { + private readonly Qualifier: PropertyType; + private readonly Required: boolean; + private readonly Type: ClassType; + + public constructor(config: InjectConfig = {}) { + this.Qualifier = config.qualifier; + this.Required = config.required; + this.Type = config.type; + } + + public onPropertyDecorator = (clazz: Class, target: Object, propertyKey: PropertyType): void => { + console.log('Inject'); + } + public onMethodDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, + descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void => { + console.log('Inject'); + } + public onParameterDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, parameterIndex: number): void => { + console.log('Inject'); + } + +} + +export const Inject = Decorator.create(InjectAnnotation); export default Inject; - - - diff --git a/src/ts/@loafer/pouches/decorator/InjectConfig.ts b/src/ts/@loafer/pouches/decorator/InjectConfig.ts deleted file mode 100644 index 8b83b22..0000000 --- a/src/ts/@loafer/pouches/decorator/InjectConfig.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ClassType, PropertyType } from '@loafer/core/constants'; - -interface InjectConfig { - qualifier?: PropertyType; - required?: boolean; - clazz?: ClassType; -} - -export default InjectConfig; diff --git a/src/ts/@loafer/pouches/decorator/Injectable.ts b/src/ts/@loafer/pouches/decorator/Injectable.ts index f0aa0f9..1d6c917 100644 --- a/src/ts/@loafer/pouches/decorator/Injectable.ts +++ b/src/ts/@loafer/pouches/decorator/Injectable.ts @@ -1,26 +1,28 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -import GetAppContext from '@loafer/context'; -import { validateQualifier } from '@loafer/pouches/util/qualifier'; -import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -import PouchDefinitionRegistry from '@loafer/pouches/factory/registry/PouchDefinitionRegistry'; +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; -const Injectable = (qualifier?: string | symbol ) => createDecorator('Injectable', { - classDecorator: (target: TFunction): TFunction | void => { - let injectableDefinition: InjectableDefinition = getInjectableDefinition(target.prototype, InjectableDefinition, false); - if (undefined !== injectableDefinition) { - throw new Error('Cannot apply @Injectable decorator multiple times.'); - } +import { + Class, +} from '@loafer/core/reflect'; - injectableDefinition = getInjectableDefinition(target.prototype, InjectableDefinition, true); - injectableDefinition.Qualifier = validateQualifier(target.prototype, qualifier); +export class InjectableAnnotation implements DecoratorHandler { + private readonly Qualifier: PropertyType; - return target; - }, + public constructor(qualifier?: PropertyType) { + this.Qualifier = qualifier; + } + public onClassDecorator = (clazz: Class, target: TFunction): TFunction | void => { + console.log('Injectable'); + } -}); +} +export const Injectable = Decorator.create(InjectableAnnotation); export default Injectable; diff --git a/src/ts/@loafer/pouches/decorator/PostConstruct.ts b/src/ts/@loafer/pouches/decorator/PostConstruct.ts index 53f2264..b9d4caf 100644 --- a/src/ts/@loafer/pouches/decorator/PostConstruct.ts +++ b/src/ts/@loafer/pouches/decorator/PostConstruct.ts @@ -1,16 +1,23 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -const PostConstruct = createDecorator('PostConstruct', { - methodDecorator: (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor => { - let injectableDefinition = getInjectableDefinition(target, InjectableDefinition, false); - if (undefined === injectableDefinition) { - throw new Error('Cannot apply @PostConstruct decorator on the not @Injectable or @Injectable stereotype class.'); - } - injectableDefinition.addPostConstruct(propertyKey); - return descriptor; - }, -}); +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; + +import { + Class, +} from '@loafer/core/reflect'; + +export class PostConstructAnnotation implements DecoratorHandler { + public onMethodDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, + descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void => { + console.log('PostConstruct'); + } +} + +export const PostConstruct = Decorator.create(PostConstructAnnotation); export default PostConstruct; diff --git a/src/ts/@loafer/pouches/decorator/PreDestroy.ts b/src/ts/@loafer/pouches/decorator/PreDestroy.ts index 631ef51..53aac7a 100644 --- a/src/ts/@loafer/pouches/decorator/PreDestroy.ts +++ b/src/ts/@loafer/pouches/decorator/PreDestroy.ts @@ -1,16 +1,23 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -const PreDestroy = createDecorator('PreDestroy', { - methodDecorator: (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor => { - let injectableDefinition = getInjectableDefinition(target, InjectableDefinition, false); - if (undefined === injectableDefinition) { - throw new Error('Cannot apply @PreDestroy decorator on the not @Injectable or @Injectable stereotype class.'); - } - injectableDefinition.addPreDestroy(propertyKey); - return descriptor; - }, -}); +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; + +import { + Class, +} from '@loafer/core/reflect'; + +export class PreDestroyAnnotation implements DecoratorHandler { + public onMethodDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, + descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void => { + console.log('PreDestroy'); + } +} + +export const PreDestroy = Decorator.create(PreDestroyAnnotation); export default PreDestroy; diff --git a/src/ts/@loafer/pouches/decorator/Scope.ts b/src/ts/@loafer/pouches/decorator/Scope.ts index 0fa1931..ce3caa1 100644 --- a/src/ts/@loafer/pouches/decorator/Scope.ts +++ b/src/ts/@loafer/pouches/decorator/Scope.ts @@ -1,17 +1,28 @@ -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; -import { getInjectableDefinition } from '@loafer/pouches/util/metadata'; -import { PouchScope } from '@loafer/pouches/constants'; +import { + PropertyType, +} from '@loafer/core/constants/types'; -const Scope = (scope: PouchScope = PouchScope.SINGLETON) => createDecorator('Scope', { - classDecorator: (target: TFunction): TFunction | void => { - let injectableDefinition = getInjectableDefinition(target.prototype, InjectableDefinition, false); - if (undefined === injectableDefinition) { - throw new Error('Cannot apply @Scope decorator on the not @Injectable or @Injectable stereotype class.'); - } - injectableDefinition.Scope = scope; - return target; - }, -}); +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; + +import { + Class, +} from '@loafer/core/reflect'; + +export class ScopeAnnotation implements DecoratorHandler { + private readonly Qualifier: PropertyType; + + public constructor(qualifier?: PropertyType) { + this.Qualifier = qualifier; + } + public onClassDecorator = (clazz: Class, target: TFunction): TFunction | void => { + console.log('Scope'); + } + +} + +export const Scope = Decorator.create(ScopeAnnotation); export default Scope; diff --git a/src/ts/@loafer/pouches/decorator/Value.ts b/src/ts/@loafer/pouches/decorator/Value.ts index 8c99994..831d258 100644 --- a/src/ts/@loafer/pouches/decorator/Value.ts +++ b/src/ts/@loafer/pouches/decorator/Value.ts @@ -1,17 +1,33 @@ -import InjectDefinition from '@loafer/pouches/definition/InjectDefinition'; -import createDecorator from '@loafer/core/util/decorators/createDecorator'; -import { getInjectDefinition } from '@loafer/pouches/util/metadata'; +import { + ClassType, + PropertyType, +} from '@loafer/core/constants/types'; -const Value = (value: string) => createDecorator('Value', { - propertyDecorator: (target: Object, propertyKey: string | symbol): void => { - let injectDefinition: InjectDefinition = getInjectDefinition(target, InjectDefinition, true); - injectDefinition.addValue(value, propertyKey); - }, - parameterDecorator: (target: Object, propertyKey: string | symbol, parameterIndex: number): void => { - let injectDefinition: InjectDefinition = getInjectDefinition(target, InjectDefinition, true); - injectDefinition.addValue(value, propertyKey, parameterIndex); - }, +import { + Decorator, + DecoratorHandler, + } from '@loafer/core/decorator'; -}); +import { + Class, +} from '@loafer/core/reflect'; + +export class ValueAnnotation implements DecoratorHandler { + private readonly Value: PropertyType; + + public constructor(value: PropertyType) { + this.Value = value; + } + + public onPropertyDecorator = (clazz: Class, target: Object, propertyKey: PropertyType): void => { + console.log('Value'); + } + public onParameterDecorator = (clazz: Class, target: Object, propertyKey: PropertyType, parameterIndex: number): void => { + console.log('Value'); + } + +} + +export const Value = Decorator.create(ValueAnnotation); export default Value; diff --git a/src/ts/@loafer/pouches/util/metadata/index.ts b/src/ts/@loafer/pouches/util/metadata/index.ts deleted file mode 100644 index 397897a..0000000 --- a/src/ts/@loafer/pouches/util/metadata/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './inject'; -export * from './injectable'; diff --git a/src/ts/@loafer/pouches/util/metadata/inject.ts b/src/ts/@loafer/pouches/util/metadata/inject.ts deleted file mode 100644 index 26f2011..0000000 --- a/src/ts/@loafer/pouches/util/metadata/inject.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ClassType } from '@loafer/core/constants'; -import getClassMetadata, { - MetadataDefinable, -} from '@loafer/core/util/metadata/getClassMetadata'; - -import { POUCH_INJECT_DEFINITION } from '@loafer/pouches/constants'; -import InjectDefinition from '@loafer/pouches/definition/InjectDefinition'; - -export const getInjectDefinition = - (clazz: ClassType, definitionType: MetadataDefinable, isCreate: boolean = false) => - getClassMetadata(clazz, POUCH_INJECT_DEFINITION, definitionType, isCreate); diff --git a/src/ts/@loafer/pouches/util/metadata/injectable.ts b/src/ts/@loafer/pouches/util/metadata/injectable.ts deleted file mode 100644 index 6e4c157..0000000 --- a/src/ts/@loafer/pouches/util/metadata/injectable.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ClassType } from '@loafer/core/constants'; -import getClassMetadata, { - MetadataDefinable, -} from '@loafer/core/util/metadata/getClassMetadata'; -import { POUCH_INJECTABLE_DEFINITION } from '@loafer/pouches/constants'; -import InjectableDefinition from '@loafer/pouches/definition/InjectableDefinition'; - -export const getInjectableDefinition = (clazz: ClassType, definitionType: MetadataDefinable, isCreate: boolean = false) => - getClassMetadata(clazz, POUCH_INJECTABLE_DEFINITION, definitionType, isCreate);