diff --git a/src/test/ts/mock/Box.ts b/src/test/ts/mock/Box.ts --- a/src/test/ts/mock/Box.ts +++ b/src/test/ts/mock/Box.ts @@ -1,11 +1,8 @@ -import { Builder } from "../di/Annotations"; -import { Bar } from "./Bar"; -import { Foo } from "./Foo"; +import { config } from "./config"; -const builder = new Builder, { bar: Bar; foo: Foo; obj: object }>(); +const service = config.service("barBox"); -@builder.provides() -@builder.dependencies("bar") +@service.provides() export class Box { private _value: T | undefined; @@ -13,13 +10,12 @@ export class Box { this._value = value; } - @builder.inject("bar") + @service.inject("bar") setValue(value: T) { this._value = value; } - - @builder.inject("foo") + @service.inject("foo") setObj(value: object) { } diff --git a/src/test/ts/mock/config.ts b/src/test/ts/mock/config.ts --- a/src/test/ts/mock/config.ts +++ b/src/test/ts/mock/config.ts @@ -0,0 +1,29 @@ +import { Foo } from "./Foo"; +import { Bar } from "./Bar"; +import { ActivationType } from "../di/interfaces"; +import { Builder } from "../di/Annotations"; +import { Box } from "./Box"; + +interface RegistrationOptions { + activation?: ActivationType; +} + +interface ConfigBuilder { + service(name: K): Builder; +} + +interface ContainerServices { + barBox: Box; + + foo: Foo; + + bar: Bar; + + password: string; + + user: string; + + timeout: number; +} + +export declare const config: ConfigBuilder;