import { config } from "./config"; const service = config.service("barBox"); @service.provides() export class Box { private _value: T | undefined; constructor(value: T) { this._value = value; } @service.inject("bar") setValue(value: T) { this._value = value; } @service.inject("foo") setObj(value: object) { } getValue() { if (this._value === undefined) throw new Error("Trying to get a value from the empty box"); return this._value; } }