diff --git a/bower.json b/bower.json index a196e11..b0d18ff 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-dependency-injection", - "version": "1.5.2", + "version": "1.6.0", "description": "A lightweight, extensible dependency injection container for JavaScript.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-dependency-injection.js b/dist/amd/aurelia-dependency-injection.js index c519027..91fe8d9 100644 --- a/dist/amd/aurelia-dependency-injection.js +++ b/dist/amd/aurelia-dependency-injection.js @@ -1,683 +1,724 @@ -define('aurelia-dependency-injection', ['exports', 'aurelia-metadata', 'aurelia-pal'], function (exports, aureliaMetadata, aureliaPal) { 'use strict'; +define('aurelia-dependency-injection', ['exports', 'aurelia-metadata', 'aurelia-pal'], (function (exports, aureliaMetadata, aureliaPal) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + /****************************************************************************** + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - } - - function isInjectable(potentialTarget) { - return !!potentialTarget; - } - function autoinject(potentialTarget) { - var deco = function (target) { - if (!target.hasOwnProperty('inject')) { - target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; - } - function inject() { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return function (target, _key, descriptor) { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - var fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; - } + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; - var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; - }); - (function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; - })(exports.Strategy || (exports.Strategy = {})); - function isStrategy(actual, expected, state) { - return actual === expected; - } - var StrategyResolver = (function () { - function StrategyResolver(strategy, state) { - this.strategy = strategy; - this.state = state; - } - StrategyResolver.prototype.get = function (container, key) { - if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { - var singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - }; - StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], StrategyResolver); - return StrategyResolver; - }()); - var Lazy = (function () { - function Lazy(key) { - this._key = key; - } - Lazy_1 = Lazy; - Lazy.prototype.get = function (container) { - var _this = this; - return function () { return container.get(_this._key); }; - }; - Lazy.of = function (key) { - return new Lazy_1(key); - }; - var Lazy_1; - Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Lazy); - return Lazy; - }()); - var All = (function () { - function All(key) { - this._key = key; - } - All_1 = All; - All.prototype.get = function (container) { - return container.getAll(this._key); - }; - All.of = function (key) { - return new All_1(key); - }; - var All_1; - All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], All); - return All; - }()); - var Optional = (function () { - function Optional(key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - this._key = key; - this._checkParent = checkParent; - } - Optional_1 = Optional; - Optional.prototype.get = function (container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - }; - Optional.of = function (key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - return new Optional_1(key, checkParent); - }; - var Optional_1; - Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], Optional); - return Optional; - }()); - var Parent = (function () { - function Parent(key) { - this._key = key; - } - Parent_1 = Parent; - Parent.prototype.get = function (container) { - return container.parent ? container.parent.get(this._key) : null; - }; - Parent.of = function (key) { - return new Parent_1(key); - }; - var Parent_1; - Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Parent); - return Parent; - }()); - var Factory = (function () { - function Factory(key) { - this._key = key; - } - Factory_1 = Factory; - Factory.prototype.get = function (container) { - var fn = this._key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === exports.Strategy.function) { - fn = resolver.state; - } - return function () { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return container.invoke(fn, rest); - }; - }; - Factory.of = function (key) { - return new Factory_1(key); - }; - var Factory_1; - Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Factory); - return Factory; - }()); - var NewInstance = (function () { - function NewInstance(key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - NewInstance_1 = NewInstance; - NewInstance.prototype.get = function (container) { - var dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(function (dependency) { - return dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency); - }) - : undefined; - var fn = this.key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - var instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - }; - NewInstance.prototype.as = function (key) { - this.asKey = key; - return this; - }; - NewInstance.of = function (key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))(); - }; - var NewInstance_1; - NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], NewInstance); - return NewInstance; - }()); - function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; - } - function lazy(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; - } - function all(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; - } - function optional(checkParentOrTarget) { - if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } - var deco = function (checkParent) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); - } - function parent(target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); - } - function factory(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; - } - function newInstance(asKeyOrTarget) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - var deco = function (asKey) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies)); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); - } + function isInjectable(potentialTarget) { + return !!potentialTarget; + } + function autoinject(potentialTarget) { + var deco = function (target) { + if (!target.hasOwnProperty('inject')) { + target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; + } + function inject() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return function (target, _key, descriptor) { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + var fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; + } - function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - } - var _emptyParameters = Object.freeze([]); - aureliaMetadata.metadata.registration = 'aurelia:registration'; - aureliaMetadata.metadata.invoker = 'aurelia:invoker'; - var resolverDecorates = resolver.decorates; - var InvocationHandler = (function () { - function InvocationHandler(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - }; - return InvocationHandler; - }()); - function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - var lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); - } - var classInvoker = { - invoke: function (container, Type, deps) { - var instances = deps.map(function (dep) { return container.get(dep); }); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies: invokeWithDynamicDependencies - }; - function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; - } - var Container = (function () { - function Container(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - Container.prototype.makeGlobal = function () { - Container.instance = this; - return this; - }; - Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - }; - Container.prototype.registerInstance = function (key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - }; - Container.prototype.registerSingleton = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - }; - Container.prototype.registerTransient = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - }; - Container.prototype.registerHandler = function (key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - }; - Container.prototype.registerAlias = function (originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - }; - Container.prototype.registerResolver = function (key, resolver$$1) { - validateKey(key); - var allResolvers = this._resolvers; - var result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - }; - Container.prototype.autoRegister = function (key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - }; - Container.prototype.autoRegisterAll = function (fns) { - var i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - }; - Container.prototype.unregister = function (key) { - this._resolvers.delete(key); - }; - Container.prototype.hasResolver = function (key, checkParent) { - if (checkParent === void 0) { checkParent = false; } - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - }; - Container.prototype.getResolver = function (key) { - return this._resolvers.get(key); - }; - Container.prototype.get = function (key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - }; - Container.prototype._get = function (key) { - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - }; - Container.prototype.getAll = function (key) { - validateKey(key); - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - var state = resolver$$1.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - }; - Container.prototype.createChild = function () { - var child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - }; - Container.prototype.invoke = function (fn, dynamicDependencies) { - try { - var handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new aureliaPal.AggregateError("Error invoking " + fn.name + ". Check the inner error for details.", e, true); - } - }; - Container.prototype._createInvocationHandler = function (fn) { - var dependencies; - if (fn.inject === undefined) { - dependencies = - aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - var ctor = fn; - while (typeof ctor === 'function') { - dependencies.push.apply(dependencies, getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; - var handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - }; - return Container; - }()); + var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; + }); + exports.Strategy = void 0; + (function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; + })(exports.Strategy || (exports.Strategy = {})); + function isStrategy(actual, expected, state) { + return actual === expected; + } + var StrategyResolver = (function () { + function StrategyResolver(strategy, state) { + this.strategy = strategy; + this.state = state; + } + StrategyResolver.prototype.get = function (container, key) { + if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { + var singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + }; + StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], StrategyResolver); + return StrategyResolver; + }()); + var Lazy = (function () { + function Lazy(key) { + this._key = key; + } + Lazy_1 = Lazy; + Lazy.prototype.get = function (container) { + var _this = this; + return function () { return container.get(_this._key); }; + }; + Lazy.of = function (key) { + return new Lazy_1(key); + }; + var Lazy_1; + Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Lazy); + return Lazy; + }()); + var All = (function () { + function All(key) { + this._key = key; + } + All_1 = All; + All.prototype.get = function (container) { + return container.getAll(this._key); + }; + All.of = function (key) { + return new All_1(key); + }; + var All_1; + All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], All); + return All; + }()); + var Optional = (function () { + function Optional(key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + this._key = key; + this._checkParent = checkParent; + } + Optional_1 = Optional; + Optional.prototype.get = function (container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + }; + Optional.of = function (key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + return new Optional_1(key, checkParent); + }; + var Optional_1; + Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], Optional); + return Optional; + }()); + var Parent = (function () { + function Parent(key) { + this._key = key; + } + Parent_1 = Parent; + Parent.prototype.get = function (container) { + return container.parent ? container.parent.get(this._key) : null; + }; + Parent.of = function (key) { + return new Parent_1(key); + }; + var Parent_1; + Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Parent); + return Parent; + }()); + var Factory = (function () { + function Factory(key) { + this._key = key; + } + Factory_1 = Factory; + Factory.prototype.get = function (container) { + var fn = this._key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === exports.Strategy.function) { + fn = resolver.state; + } + return function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return container.invoke(fn, rest); + }; + }; + Factory.of = function (key) { + return new Factory_1(key); + }; + var Factory_1; + Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Factory); + return Factory; + }()); + var NewInstance = (function () { + function NewInstance(key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + NewInstance_1 = NewInstance; + NewInstance.prototype.get = function (container) { + var dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(function (dependency) { + return dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency); + }) + : undefined; + var fn = this.key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + var instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + }; + NewInstance.prototype.as = function (key) { + this.asKey = key; + return this; + }; + NewInstance.of = function (key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + return new (NewInstance_1.bind.apply(NewInstance_1, __spreadArray([void 0, key], dynamicDependencies, false)))(); + }; + var NewInstance_1; + NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], NewInstance); + return NewInstance; + }()); + function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; + } + function lazy(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; + } + function all(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; + } + function optional(checkParentOrTarget) { + if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } + var deco = function (checkParent) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); + } + function parent(target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); + } + function factory(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; + } + function newInstance(asKeyOrTarget) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + var deco = function (asKey) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of.apply(NewInstance, __spreadArray([inject[index]], dynamicDependencies, false)); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); + } - function invoker(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); - }; - } - function invokeAsFactory(potentialTarget) { - var deco = function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; - } - var FactoryInvoker = (function () { - function FactoryInvoker() { - } - FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { - var i = dependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - }; - FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - }; - return FactoryInvoker; - }()); - FactoryInvoker.instance = new FactoryInvoker(); + var currentContainer = null; + function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + } + var _emptyParameters = Object.freeze([]); + aureliaMetadata.metadata.registration = 'aurelia:registration'; + aureliaMetadata.metadata.invoker = 'aurelia:invoker'; + var resolverDecorates = resolver.decorates; + var InvocationHandler = (function () { + function InvocationHandler(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { + var previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + }; + return InvocationHandler; + }()); + function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + var lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); + } + var classInvoker = { + invoke: function (container, Type, deps) { + var instances = deps.map(function (dep) { return container.get(dep); }); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies: invokeWithDynamicDependencies + }; + function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; + } + var Container = (function () { + function Container(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + Container.prototype.makeGlobal = function () { + Container.instance = this; + return this; + }; + Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + }; + Container.prototype.registerInstance = function (key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + }; + Container.prototype.registerSingleton = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.singleton, fn === undefined ? key : fn)); + }; + Container.prototype.registerTransient = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + }; + Container.prototype.registerHandler = function (key, handler) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.function, handler)); + }; + Container.prototype.registerAlias = function (originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + }; + Container.prototype.registerResolver = function (key, resolver) { + validateKey(key); + var allResolvers = this._resolvers; + var result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + }; + Container.prototype.autoRegister = function (key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + }; + Container.prototype.autoRegisterAll = function (fns) { + var i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + }; + Container.prototype.unregister = function (key) { + this._resolvers.delete(key); + }; + Container.prototype.hasResolver = function (key, checkParent) { + if (checkParent === void 0) { checkParent = false; } + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + }; + Container.prototype.getResolver = function (key) { + return this._resolvers.get(key); + }; + Container.prototype.get = function (key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + }; + Container.prototype._get = function (key) { + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + }; + Container.prototype.getAll = function (key) { + validateKey(key); + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + var state = resolver.state; + var i = state.length; + var results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + }; + Container.prototype.createChild = function () { + var child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + }; + Container.prototype.invoke = function (fn, dynamicDependencies) { + try { + var handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new aureliaPal.AggregateError("Error invoking ".concat(fn.name, ". Check the inner error for details."), e, true); + } + }; + Container.prototype._createInvocationHandler = function (fn) { + var dependencies; + if (fn.inject === undefined) { + dependencies = + aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + var ctor = fn; + while (typeof ctor === 'function') { + dependencies.push.apply(dependencies, getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; + var handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + }; + return Container; + }()); + function resolve() { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + if (currentContainer == null) { + throw new Error("There is not a currently active container to resolve \"".concat(String(keys), "\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?")); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); + } + function containerGetKey(key) { + return this.get(key); + } - function registration(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); - }; - } - function transient(key) { - return registration(new TransientRegistration(key)); - } - function singleton(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); - } - var TransientRegistration = (function () { - function TransientRegistration(key) { - this._key = key; - } - TransientRegistration.prototype.registerResolver = function (container, key, fn) { - var existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - }; - return TransientRegistration; - }()); - var SingletonRegistration = (function () { - function SingletonRegistration(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - SingletonRegistration.prototype.registerResolver = function (container, key, fn) { - var targetContainer = this._registerInChild ? container : container.root; - var existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - }; - return SingletonRegistration; - }()); + function invoker(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); + }; + } + function invokeAsFactory(potentialTarget) { + var deco = function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; + } + var FactoryInvoker = (function () { + function FactoryInvoker() { + } + FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { + var i = dependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + }; + FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + }; + return FactoryInvoker; + }()); + FactoryInvoker.instance = new FactoryInvoker(); - exports._emptyParameters = _emptyParameters; - exports.InvocationHandler = InvocationHandler; - exports.Container = Container; - exports.autoinject = autoinject; - exports.inject = inject; - exports.invoker = invoker; - exports.invokeAsFactory = invokeAsFactory; - exports.FactoryInvoker = FactoryInvoker; - exports.registration = registration; - exports.transient = transient; - exports.singleton = singleton; - exports.TransientRegistration = TransientRegistration; - exports.SingletonRegistration = SingletonRegistration; - exports.resolver = resolver; - exports.StrategyResolver = StrategyResolver; - exports.Lazy = Lazy; - exports.All = All; - exports.Optional = Optional; - exports.Parent = Parent; - exports.Factory = Factory; - exports.NewInstance = NewInstance; - exports.getDecoratorDependencies = getDecoratorDependencies; - exports.lazy = lazy; - exports.all = all; - exports.optional = optional; - exports.parent = parent; - exports.factory = factory; - exports.newInstance = newInstance; + function registration(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); + }; + } + function transient(key) { + return registration(new TransientRegistration(key)); + } + function singleton(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); + } + var TransientRegistration = (function () { + function TransientRegistration(key) { + this._key = key; + } + TransientRegistration.prototype.registerResolver = function (container, key, fn) { + var existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + }; + return TransientRegistration; + }()); + var SingletonRegistration = (function () { + function SingletonRegistration(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + SingletonRegistration.prototype.registerResolver = function (container, key, fn) { + var targetContainer = this._registerInChild ? container : container.root; + var existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + }; + return SingletonRegistration; + }()); - Object.defineProperty(exports, '__esModule', { value: true }); + exports.All = All; + exports.Container = Container; + exports.Factory = Factory; + exports.FactoryInvoker = FactoryInvoker; + exports.InvocationHandler = InvocationHandler; + exports.Lazy = Lazy; + exports.NewInstance = NewInstance; + exports.Optional = Optional; + exports.Parent = Parent; + exports.SingletonRegistration = SingletonRegistration; + exports.StrategyResolver = StrategyResolver; + exports.TransientRegistration = TransientRegistration; + exports._emptyParameters = _emptyParameters; + exports.all = all; + exports.autoinject = autoinject; + exports.factory = factory; + exports.getDecoratorDependencies = getDecoratorDependencies; + exports.inject = inject; + exports.invokeAsFactory = invokeAsFactory; + exports.invoker = invoker; + exports.lazy = lazy; + exports.newInstance = newInstance; + exports.optional = optional; + exports.parent = parent; + exports.registration = registration; + exports.resolve = resolve; + exports.resolver = resolver; + exports.singleton = singleton; + exports.transient = transient; -}); +})); +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/amd/aurelia-dependency-injection.js.map b/dist/amd/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..67b6ad9 --- /dev/null +++ b/dist/amd/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":["metadata","protocol","Strategy","AggregateError"],"mappings":";;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;AAsCA;IACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;IAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IA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C,QAAA,IAAA,eAAA,KAAA,KAAA,CAAA,EAAA,EAAA,eAAgC,GAAA,KAAA,CAAA,EAAA;IAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;IAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;aAC9C;iBAAM;IACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;aACzC;SACF;IASM,IAAA,qBAAA,CAAA,SAAA,CAAA,gBAAgB,GAAvB,UACE,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;IAEhD,QAAA,IAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;IAC3E,QAAA,IAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;YACvE,OAAO,gBAAgB,KAAK,SAAS;IACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;kBACvD,gBAAgB,CAAC;SACtB,CAAA;QACH,OAAC,qBAAA,CAAA;IAAD,CAAC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/aurelia-dependency-injection.d.ts b/dist/aurelia-dependency-injection.d.ts index f12f649..25eebfe 100644 --- a/dist/aurelia-dependency-injection.d.ts +++ b/dist/aurelia-dependency-injection.d.ts @@ -1,50 +1,37 @@ -export type Primitive = boolean - | string - | number - | symbol - | object - | ((...args: any[]) => any) - | Array; +// Generated by dts-bundle-generator v9.5.1 + +export type Primitive = boolean | string | number | symbol | object | ((...args: any[]) => any) | Array; export type CtorArgs = TBase extends new (...args: infer TArgs) => infer Impl ? TArgs : any[]; export type CtorImpl = TBase extends new (...args: infer TArgs) => infer Impl ? Impl : any; export type FuncArgs = TBase extends (...args: infer TArgs) => infer Impl ? TArgs : any[]; export type FuncReturns = TBase extends (...args: infer TArgs) => infer Impl ? Impl : any; -export type Args = CtorArgs|FuncArgs; -export type Impl = CtorImpl|FuncReturns; -export type DependencyCtor< - TBase, - TImpl extends Impl = Impl, - TArgs extends Args = Args - > = new (...args: TArgs) => TImpl | TBase; -export type DependencyFunctor< - TBase, - TImpl extends Impl = Impl, - TArgs extends Args = Args - > = (...args: TArgs) => TImpl | TBase; +export type Args = CtorArgs | FuncArgs; +export type Impl = CtorImpl | FuncReturns; +export type DependencyCtor = Impl, TArgs extends Args = Args> = new (...args: TArgs) => TImpl | TBase; +export type DependencyFunctor = Impl, TArgs extends Args = Args> = (...args: TArgs) => TImpl | TBase; export type ImplOrAny = unknown extends TImpl ? any : TImpl; -export type DependencyCtorOrFunctor< - TBase, - TImpl extends Impl = Impl, - TArgs extends Args = Args - > = DependencyCtor | DependencyFunctor; -export type PrimitiveOrDependencyCtor< - TBase, - TImpl extends Impl = Impl, - TArgs extends Args = Args - > = DependencyCtor | Primitive; -export type PrimitiveOrDependencyCtorOrFunctor< - TBase, - TImpl extends Impl = Impl, - TArgs extends Args = Args - > = DependencyCtor - | DependencyFunctor - | Primitive; +export type DependencyCtorOrFunctor = Impl, TArgs extends Args = Args> = DependencyCtor | DependencyFunctor; +export type PrimitiveOrDependencyCtor = Impl, TArgs extends Args = Args> = DependencyCtor | Primitive; +export type PrimitiveOrDependencyCtorOrFunctor = Impl, TArgs extends Args = Args> = DependencyCtor | DependencyFunctor | Primitive; +/** + * Decorator: Indicates that the decorated class/object is a custom resolver. + */ export declare const resolver: { decorates?: (key: any) => key is { get(container: Container, key: any): any; }; } & (() => any); +/** + * Used to allow functions/classes to specify custom dependency resolution logic. + */ export interface Resolver { + /** + * Called by the container to allow custom resolution of dependencies for a + * function/class. + * @param container The container to resolve from. + * @param key The key that the resolver was registered as. + * @return Returns the resolved object. + */ get(container: Container, key: any): any; } export declare enum Strategy { @@ -55,149 +42,649 @@ export declare enum Strategy { array = 4, alias = 5 } -export declare type IStrategy = 1 | 2 | 3 | 4 | 5; -export declare type StrategyFunctor = Impl, TArgs extends Args = Args> = (container?: Container, ctor?: PrimitiveOrDependencyCtorOrFunctor, strategyResolver?: any) => TImpl; +export type IStrategy = 1 | 2 | 3 | 4 | 5; +export type StrategyFunctor = Impl, TArgs extends Args = Args> = (container?: Container, ctor?: PrimitiveOrDependencyCtorOrFunctor, strategyResolver?: any) => TImpl; export interface StrategyState = Impl, TArgs extends Args = Args> { [Strategy.instance]: TImpl; [Strategy.singleton]: DependencyCtorOrFunctor; [Strategy.transient]: DependencyCtorOrFunctor; [Strategy.function]: StrategyFunctor; + /** + * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[] + * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]] + */ [Strategy.array]: ({ get: (container: Container, key: PrimitiveOrDependencyCtor) => TImpl; } | TImpl)[]; [Strategy.alias]: any; } +/** + * Used to resolve instances, singletons, transients, aliases + */ export declare class StrategyResolver, TArgs extends Args, TStrategyKey extends keyof StrategyState> { strategy: keyof StrategyState; state: StrategyState[keyof StrategyState]; + /** + * Creates an instance of the StrategyResolver class. + * @param strategy The type of resolution strategy. + * @param state The state associated with the resolution strategy. + */ constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]); + /** + * Called by the container to allow custom resolution of dependencies for a + * function/class. + * @param container The container to resolve from. + * @param key The key that the resolver was registered as. + * @return Returns the resolved object. + */ get(container: Container, key: PrimitiveOrDependencyCtor): TImpl; } +/** + * Used to allow functions/classes to specify lazy resolution logic. + */ export declare class Lazy = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "lazy"; + /** + * Creates an instance of the Lazy class. + * @param key The key to lazily resolve. + */ constructor(key: PrimitiveOrDependencyCtor); + /** + * Called by the container to lazily resolve the dependency into a lazy locator + * function. + * @param container The container to resolve from. + * @return Returns a function which can be invoked at a later time to obtain + * the actual dependency. + */ get(container: Container): () => ImplOrAny; + /** + * Creates a Lazy Resolver for the supplied key. + * @param key The key to lazily resolve. + * @return Returns an instance of Lazy for the key. + */ static of = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor): Lazy; } +/** + * Used to allow functions/classes to specify resolution of all matches to a key. + */ export declare class All = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "all"; + /** + * Creates an instance of the All class. + * @param key The key to lazily resolve all matches for. + */ constructor(key: PrimitiveOrDependencyCtor); + /** + * Called by the container to resolve all matching dependencies as an array of + * instances. + * @param container The container to resolve from. + * @return Returns an array of all matching instances. + */ get(container: Container): TImpl[]; + /** + * Creates an All Resolver for the supplied key. + * @param key The key to resolve all instances for. + * @return Returns an instance of All for the key. + */ static of = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor): All; } +/** + * Used to allow functions/classes to specify an optional dependency, which will + * be resolved only if already registred with the container. + */ export declare class Optional = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "optional"; + /** + * Creates an instance of the Optional class. + * @param key The key to optionally resolve for. + * @param checkParent Indicates whether or not the parent container hierarchy + * should be checked. + */ constructor(key: PrimitiveOrDependencyCtor, checkParent?: boolean); - get(container: Container): TImpl; + /** + * Called by the container to provide optional resolution of the key. + * @param container The container to resolve from. + * @return Returns the instance if found; otherwise null. + */ + get(container: Container): TImpl | null; + /** + * Creates an Optional Resolver for the supplied key. + * @param key The key to optionally resolve for. + * @param [checkParent=true] Indicates whether or not the parent container + * hierarchy should be checked. + * @return Returns an instance of Optional for the key. + */ static of = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor, checkParent?: boolean): Optional; } +/** + * Used to inject the dependency from the parent container instead of the current + * one. + */ export declare class Parent = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "parent"; + /** + * Creates an instance of the Parent class. + * @param key The key to resolve from the parent container. + */ constructor(key: PrimitiveOrDependencyCtor); - get(container: Container): TImpl; + /** + * Called by the container to load the dependency from the parent container + * @param container The container to resolve the parent from. + * @return Returns the matching instance from the parent container + */ + get(container: Container): TImpl | null; + /** + * Creates a Parent Resolver for the supplied key. + * @param key The key to resolve. + * @return Returns an instance of Parent for the key. + */ static of = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor): Parent; } +/** + * Used to allow injecting dependencies but also passing data to the constructor. + */ export declare class Factory = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "factory"; + /** + * Creates an instance of the Factory class. + * @param key The key to resolve from the parent container. + */ constructor(key: PrimitiveOrDependencyCtorOrFunctor); + /** + * Called by the container to pass the dependencies to the constructor. + * @param container The container to invoke the constructor with dependencies + * and other parameters. + * @return Returns a function that can be invoked to resolve dependencies + * later, and the rest of the parameters. + */ get(container: Container): DependencyFunctor; + /** + * Creates a Factory Resolver for the supplied key. + * @param key The key to resolve. + * @return Returns an instance of Factory for the key. + */ static of = Impl, TArgs extends Args = Args>(key: DependencyCtor): Factory; } +/** + * Used to inject a new instance of a dependency, without regard for existing + * instances in the container. Instances can optionally be registered in the + * container + * under a different key by supplying a key using the `as` method. + */ export declare class NewInstance = Impl, TArgs extends Args = Args> { + /** + * A non existent property to help TS distinguish resolvers + * + * This is semi-private, and should not be used by application + */ + __resolver_type__: "newInstance"; + /** + * Creates an instance of the NewInstance class. + * @param key The key to resolve/instantiate. + * @param dynamicDependencies An optional list of dynamic dependencies. + */ constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]); + /** + * Called by the container to instantiate the dependency and potentially + * register + * as another key if the `as` method was used. + * @param container The container to resolve the parent from. + * @return Returns the matching instance from the parent container + */ get(container: Container): ImplOrAny; + /** + * Instructs the NewInstance resolver to register the resolved instance using + * the supplied key. + * @param key The key to register the instance with. + * @return Returns the NewInstance resolver. + */ as(key: PrimitiveOrDependencyCtorOrFunctor): this; + /** + * Creates an NewInstance Resolver for the supplied key. + * @param key The key to resolve/instantiate. + * @param dynamicDependencies An optional list of dynamic dependencies. + * @return Returns an instance of NewInstance for the key. + */ static of = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]): NewInstance; } +/** + * Used by parameter decorators to call autoinject for the target and retrieve + * the target's inject property. + * @param target The target class. + * @return Returns the target's own inject property. + */ export declare function getDecoratorDependencies = Impl, TArgs extends Args = Args>(target: DependencyCtor & { inject?: TArgs[number][]; -}): TArgs[number][]; -export declare function lazy = Impl, TArgs extends Args = Args>(keyValue: any): (target: DependencyCtor & { - inject?: TArgs[number][]; +}): TArgs[number][] | undefined; +/** + * Decorator: Specifies the dependency should be lazy loaded + */ +export declare function lazy = Impl, TArgs extends Args = Args>(keyValue: any): (target: { + new (...args: TArgs): TBase | TImpl; }, _key: any, index: number) => void; +/** + * Decorator: Specifies the dependency should load all instances of the given + * key. + */ export declare function all = Impl, TArgs extends Args = Args>(keyValue: any): (target: DependencyCtor & { inject?: TArgs[number][]; }, _key: any, index: number) => void; +/** + * Decorator: Specifies the dependency as optional + */ export declare function optional = Impl, TArgs extends Args = Args>(checkParentOrTarget?: boolean): (target: DependencyCtor & { inject?: TArgs[number][]; }, _key: any, index: number) => void; -export declare function parent = Impl, TArgs extends Args = Args>(target: DependencyCtor & { +/** + * Decorator: Specifies the dependency to look at the parent container for + * resolution + */ +declare function parent$1 = Impl, TArgs extends Args = Args>(target: DependencyCtor & { inject?: TArgs[number][]; }, _key: any, index: number): void; +/** + * Decorator: Specifies the dependency to create a factory method, that can + * accept optional arguments + */ export declare function factory = Impl, TArgs extends Args = Args>(keyValue: any): (target: DependencyCtor & { inject?: TArgs[number][]; }, _key: any, index: number) => void; +/** + * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container + * under a different key and/or use dynamic dependencies + */ export declare function newInstance = Impl, TArgs extends Args = Args>(asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][]; -}, ...dynamicDependencies: TArgs[number][]): (target: DependencyCtor & { - inject?: TArgs[number][]; +}, ...dynamicDependencies: TArgs[number][]): (target: { + new (...args: any[]): any; }, _key: any, index: number) => void; +/** + * Decorator: Specifies a custom Invoker for the decorated item. + */ export declare function invoker, TArgs extends Args>(value: Invoker): (target: DependencyCtor) => void; +/** + * Decorator: Specifies that the decorated item should be called as a factory + * function, rather than a constructor. + */ export declare function invokeAsFactory, TArgs extends Args>(potentialTarget?: DependencyCtor): void | ((target: DependencyCtor) => void); +/** + * A strategy for invoking a function, resulting in an object instance. + */ export interface Invoker, TArgs extends Args> { + /** + * Invokes the function with the provided dependencies. + * @param fn The constructor or factory function. + * @param dependencies The dependencies of the function call. + * @return The result of the function invocation. + */ invoke(container: Container, fn: DependencyCtorOrFunctor, dependencies: TArgs): ImplOrAny; + /** + * Invokes the function with the provided dependencies. + * @param fn The constructor or factory function. + * @param staticDependencies The static dependencies of the function. + * @param dynamicDependencies Additional dependencies to use during + * invocation. + * @return The result of the function invocation. + */ invokeWithDynamicDependencies(container: Container, fn: DependencyCtorOrFunctor, staticDependencies: TArgs[number][], dynamicDependencies: TArgs[number][]): ImplOrAny; } +/** + * An Invoker that is used to invoke a factory method. + */ export declare class FactoryInvoker = Impl, TArgs extends Args = Args> implements Invoker { + /** + * The singleton instance of the FactoryInvoker. + */ static instance: FactoryInvoker; + /** + * Invokes the function with the provided dependencies. + * @param container The calling container. + * @param fn The constructor or factory function. + * @param dependencies The dependencies of the function call. + * @return The result of the function invocation. + */ invoke(container: Container, fn: DependencyCtorOrFunctor, dependencies: TArgs): ImplOrAny; + /** + * Invokes the function with the provided dependencies. + * @param container The calling container. + * @param fn The constructor or factory function. + * @param staticDependencies The static dependencies of the function. + * @param dynamicDependencies Additional dependencies to use during invocation. + * @return The result of the function invocation. + */ invokeWithDynamicDependencies(container: Container, fn: DependencyCtorOrFunctor, staticDependencies: TArgs[number][], dynamicDependencies: TArgs[number][]): ImplOrAny; } -export declare const _emptyParameters: []; +/** + * Stores the information needed to invoke a function. + */ export declare class InvocationHandler, TArgs extends Args> { + /** + * The function to be invoked by this handler. + */ fn: DependencyCtorOrFunctor; + /** + * The invoker implementation that will be used to actually invoke the function. + */ invoker: Invoker; + /** + * The statically known dependencies of this function invocation. + */ dependencies: TArgs; + /** + * Instantiates an InvocationDescription. + * @param fn The Function described by this description object. + * @param invoker The strategy for invoking the function. + * @param dependencies The static dependencies of the function call. + */ constructor(fn: DependencyCtorOrFunctor, invoker: Invoker, dependencies: TArgs); + /** + * Invokes the function. + * @param container The calling container. + * @param dynamicDependencies Additional dependencies to use during invocation. + * @return The result of the function invocation. + */ invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl; } +/** + * Used to configure a Container instance. + */ export interface ContainerConfiguration { + /** + * An optional callback which will be called when any function needs an + * InvocationHandler created (called once per Function). + */ onHandlerCreated?: (handler: InvocationHandler) => InvocationHandler; handlers?: Map; } +/** + * A lightweight, extensible dependency injection container. + */ export declare class Container { + /** + * The global root Container instance. Available if makeGlobal() has been + * called. Aurelia Framework calls makeGlobal(). + */ static instance: Container; - parent: Container; + /** + * The parent container in the DI hierarchy. + */ + parent: Container | null; + /** + * The root container in the DI hierarchy. + */ root: Container; + /** + * Creates an instance of Container. + * @param configuration Provides some configuration for the new Container instance. + */ constructor(configuration?: ContainerConfiguration); + /** + * Makes this container instance globally reachable through Container.instance. + */ makeGlobal(): Container; + /** + * Sets an invocation handler creation callback that will be called when new + * InvocationsHandlers are created (called once per Function). + * @param onHandlerCreated The callback to be called when an + * InvocationsHandler is created. + */ setHandlerCreatedCallback = Impl, TArgs extends Args = Args>(onHandlerCreated: (handler: InvocationHandler) => InvocationHandler): void; + /** + * Registers an existing object instance with the container. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param instance The instance that will be resolved when the key is matched. + * This defaults to the key value when instance is not supplied. + * @return The resolver that was registered. + */ registerInstance = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor, instance?: TImpl): Resolver; + /** + * Registers a type (constructor function) such that the container always + * returns the same instance for each request. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param fn The constructor function to use when the dependency needs to be + * instantiated. This defaults to the key value when fn is not supplied. + * @return The resolver that was registered. + */ registerSingleton = Impl, TArgs extends Args = Args>(key: Primitive, fn: DependencyCtorOrFunctor): Resolver; registerSingleton = Impl, TArgs extends Args = Args>(key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver; + /** + * Registers a type (constructor function) such that the container returns a + * new instance for each request. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param fn The constructor function to use when the dependency needs to be + * instantiated. This defaults to the key value when fn is not supplied. + * @return The resolver that was registered. + */ registerTransient = Impl, TArgs extends Args = Args>(key: Primitive, fn: DependencyCtorOrFunctor): Resolver; registerTransient = Impl, TArgs extends Args = Args>(key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver; + /** + * Registers a custom resolution function such that the container calls this + * function for each request to obtain the instance. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param handler The resolution function to use when the dependency is + * needed. + * @return The resolver that was registered. + */ registerHandler = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor, handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any): Resolver; + /** + * Registers an additional key that serves as an alias to the original DI key. + * @param originalKey The key that originally identified the dependency; usually a constructor function. + * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original. + * @return The resolver that was registered. + */ registerAlias = Impl, TArgs extends Args = Args>(originalKey: PrimitiveOrDependencyCtor, aliasKey: PrimitiveOrDependencyCtor): Resolver; + /** + * Registers a custom resolution function such that the container calls this + * function for each request to obtain the instance. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param resolver The resolver to use when the dependency is needed. + * @return The resolver that was registered. + */ registerResolver = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor, resolver: Resolver): Resolver; + /** + * Registers a type (constructor function) by inspecting its registration + * annotations. If none are found, then the default singleton registration is + * used. + * @param key The key that identifies the dependency at resolution time; + * usually a constructor function. + * @param fn The constructor function to use when the dependency needs to be + * instantiated. This defaults to the key value when fn is not supplied. + */ autoRegister = Impl, TArgs extends Args = Args>(key: Primitive, fn: DependencyCtorOrFunctor): Resolver; autoRegister = Impl, TArgs extends Args = Args>(key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver; + /** + * Registers an array of types (constructor functions) by inspecting their + * registration annotations. If none are found, then the default singleton + * registration is used. + * @param fns The constructor function to use when the dependency needs to be instantiated. + */ autoRegisterAll(fns: DependencyCtor[]): void; + /** + * Unregisters based on key. + * @param key The key that identifies the dependency at resolution time; usually a constructor function. + */ unregister(key: any): void; + /** + * Inspects the container to determine if a particular key has been registred. + * @param key The key that identifies the dependency at resolution time; usually a constructor function. + * @param checkParent Indicates whether or not to check the parent container hierarchy. + * @return Returns true if the key has been registred; false otherwise. + */ hasResolver = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor, checkParent?: boolean): boolean; + /** + * Gets the resolver for the particular key, if it has been registered. + * @param key The key that identifies the dependency at resolution time; usually a constructor function. + * @return Returns the resolver, if registred, otherwise undefined. + */ getResolver, TBase, TImpl extends Impl = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtorOrFunctor): StrategyResolver; + /** + * Resolves a single instance based on the provided key. + * @param key The key that identifies the object to resolve. + * @return Returns the resolved instance. + */ + get | Lazy | Factory | Optional | Parent | All>(key: TResolver): ResolvedValue; get = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor): ImplOrAny; get = Impl, TArgs extends Args = Args>(key: typeof Container): Container; _get(key: any): any; + /** + * Resolves all instance registered under the provided key. + * @param key The key that identifies the objects to resolve. + * @return Returns an array of the resolved instances. + */ getAll = Impl, TArgs extends Args = Args>(key: PrimitiveOrDependencyCtor): ImplOrAny[]; + /** + * Creates a new dependency injection container whose parent is the current container. + * @return Returns a new container instance parented to this. + */ createChild(): Container; + /** + * Invokes a function, recursively resolving its dependencies. + * @param fn The function to invoke with the auto-resolved dependencies. + * @param dynamicDependencies Additional function dependencies to use during invocation. + * @return Returns the instance resulting from calling the function. + */ invoke = Impl, TArgs extends Args = Args>(fn: DependencyCtorOrFunctor, dynamicDependencies?: TArgs[number][]): ImplOrAny; _createInvocationHandler = Impl, TArgs extends Args = Args>(fn: DependencyCtorOrFunctor & { inject?: any; }): InvocationHandler; } -export declare type Injectable = Function & { +export type ResolvedValue = T extends { + new (...args: any[]): infer R; +} ? R : T extends Factory ? (...args: unknown[]) => R : T extends Lazy ? () => R : T extends NewInstance ? R : T extends Optional ? R | null : T extends All ? R[] : T extends Parent ? R | null : T extends [ + infer T1, + ...infer T2 +] ? [ + ResolvedValue, + ...ResolvedValue +] : T; +/** + * Resolve a key, or list of keys based on the current container. + * + * @example + * ```ts + * import { resolve } from 'aurelia-framework'; + * // or + * // import { Container, resolve } from 'aurelia-dependency-injection'; + * + * class MyCustomElement { + * someService = resolve(MyService); + * } + * ``` + */ +export declare function resolve(key: K): ResolvedValue; +export declare function resolve(...keys: K): ResolvedValue; +export type Injectable = Function & { inject?: any[] | (() => any[]); }; +/** + * Decorator: Directs the TypeScript transpiler to write-out type metadata for + * the decorated class. + */ export declare function autoinject(potentialTarget?: TPotential): TPotential extends Injectable ? void : (target: Injectable) => void; +/** + * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function. + */ export declare function inject = Impl, TArgs extends Args = Args>(...rest: TArgs[number][]): any; +/** + * Decorator: Specifies a custom registration strategy for the decorated + * class/function. + */ export declare function registration, TArgs extends Args>(value: Registration): (target: DependencyCtor) => void; +/** + * Decorator: Specifies to register the decorated item with a "transient" + * lifetime. + */ export declare function transient, TArgs extends Args>(key?: PrimitiveOrDependencyCtor): (target: DependencyCtor) => void; +/** + * Decorator: Specifies to register the decorated item with a "singleton" + * lifetime. + */ export declare function singleton(registerInChild?: boolean): any; export declare function singleton, TArgs extends Args>(key?: PrimitiveOrDependencyCtor, registerInChild?: boolean): any; +/** + * Customizes how a particular function is resolved by the Container. + */ export interface Registration, TArgs extends Args> { + /** + * Called by the container to register the resolver. + * @param container The container the resolver is being registered with. + * @param key The key the resolver should be registered as. + * @param fn The function to create the resolver for. + * @return The resolver that was registered. + */ registerResolver(container: Container, key: PrimitiveOrDependencyCtor, fn: DependencyCtorOrFunctor): Resolver; } +/** + * Used to allow functions/classes to indicate that they should be registered as + * transients with the container. + */ export declare class TransientRegistration, TArgs extends Args> implements Registration { + /** + * Creates an instance of TransientRegistration. + * @param key The key to register as. + */ constructor(key?: PrimitiveOrDependencyCtor); + /** + * Called by the container to register the resolver. + * @param container The container the resolver is being registered with. + * @param key The key the resolver should be registered as. + * @param fn The function to create the resolver for. + * @return The resolver that was registered. + */ registerResolver(container: Container, key: PrimitiveOrDependencyCtor, fn: DependencyCtorOrFunctor): Resolver; } +/** + * Used to allow functions/classes to indicate that they should be registered as + * singletons with the container. + */ export declare class SingletonRegistration, TArgs extends Args> implements Registration { + /** + * Creates an instance of SingletonRegistration. + * @param key The key to register as. + */ constructor(keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild?: boolean); + /** + * Called by the container to register the resolver. + * @param container The container the resolver is being registered with. + * @param key The key the resolver should be registered as. + * @param fn The function to create the resolver for. + * @return The resolver that was registered. + */ registerResolver(container: Container, key: PrimitiveOrDependencyCtor, fn: DependencyCtorOrFunctor): Resolver; -} \ No newline at end of file +} + +export { + parent$1 as parent, +}; + +export {}; diff --git a/dist/commonjs/aurelia-dependency-injection.js b/dist/commonjs/aurelia-dependency-injection.js index 5a17d87..11bf1b5 100644 --- a/dist/commonjs/aurelia-dependency-injection.js +++ b/dist/commonjs/aurelia-dependency-injection.js @@ -1,24 +1,24 @@ 'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); - var aureliaMetadata = require('aurelia-metadata'); var aureliaPal = require('aurelia-pal'); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 +/****************************************************************************** +Copyright (c) Microsoft Corporation. -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -29,656 +29,697 @@ function __decorate(decorators, target, key, desc) { function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function isInjectable(potentialTarget) { - return !!potentialTarget; } -function autoinject(potentialTarget) { - var deco = function (target) { - if (!target.hasOwnProperty('inject')) { - target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); } - return deco; + return to.concat(ar || Array.prototype.slice.call(from)); } -function inject() { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return function (target, _key, descriptor) { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - var fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function isInjectable(potentialTarget) { + return !!potentialTarget; +} +function autoinject(potentialTarget) { + var deco = function (target) { + if (!target.hasOwnProperty('inject')) { + target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; +} +function inject() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return function (target, _key, descriptor) { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + var fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; } -var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; -}); -(function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; -})(exports.Strategy || (exports.Strategy = {})); -function isStrategy(actual, expected, state) { - return actual === expected; -} -var StrategyResolver = (function () { - function StrategyResolver(strategy, state) { - this.strategy = strategy; - this.state = state; - } - StrategyResolver.prototype.get = function (container, key) { - if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { - var singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - }; - StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], StrategyResolver); - return StrategyResolver; -}()); -var Lazy = (function () { - function Lazy(key) { - this._key = key; - } - Lazy_1 = Lazy; - Lazy.prototype.get = function (container) { - var _this = this; - return function () { return container.get(_this._key); }; - }; - Lazy.of = function (key) { - return new Lazy_1(key); - }; - var Lazy_1; - Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Lazy); - return Lazy; -}()); -var All = (function () { - function All(key) { - this._key = key; - } - All_1 = All; - All.prototype.get = function (container) { - return container.getAll(this._key); - }; - All.of = function (key) { - return new All_1(key); - }; - var All_1; - All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], All); - return All; -}()); -var Optional = (function () { - function Optional(key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - this._key = key; - this._checkParent = checkParent; - } - Optional_1 = Optional; - Optional.prototype.get = function (container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - }; - Optional.of = function (key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - return new Optional_1(key, checkParent); - }; - var Optional_1; - Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], Optional); - return Optional; -}()); -var Parent = (function () { - function Parent(key) { - this._key = key; - } - Parent_1 = Parent; - Parent.prototype.get = function (container) { - return container.parent ? container.parent.get(this._key) : null; - }; - Parent.of = function (key) { - return new Parent_1(key); - }; - var Parent_1; - Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Parent); - return Parent; -}()); -var Factory = (function () { - function Factory(key) { - this._key = key; - } - Factory_1 = Factory; - Factory.prototype.get = function (container) { - var fn = this._key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === exports.Strategy.function) { - fn = resolver.state; - } - return function () { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return container.invoke(fn, rest); - }; - }; - Factory.of = function (key) { - return new Factory_1(key); - }; - var Factory_1; - Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Factory); - return Factory; -}()); -var NewInstance = (function () { - function NewInstance(key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - NewInstance_1 = NewInstance; - NewInstance.prototype.get = function (container) { - var dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(function (dependency) { - return dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency); - }) - : undefined; - var fn = this.key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - var instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - }; - NewInstance.prototype.as = function (key) { - this.asKey = key; - return this; - }; - NewInstance.of = function (key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))(); - }; - var NewInstance_1; - NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], NewInstance); - return NewInstance; -}()); -function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; -} -function lazy(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; -} -function all(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; -} -function optional(checkParentOrTarget) { - if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } - var deco = function (checkParent) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); -} -function parent(target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); -} -function factory(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; -} -function newInstance(asKeyOrTarget) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - var deco = function (asKey) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies)); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); +var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; +}); +exports.Strategy = void 0; +(function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; +})(exports.Strategy || (exports.Strategy = {})); +function isStrategy(actual, expected, state) { + return actual === expected; +} +var StrategyResolver = (function () { + function StrategyResolver(strategy, state) { + this.strategy = strategy; + this.state = state; + } + StrategyResolver.prototype.get = function (container, key) { + if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { + var singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + }; + StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], StrategyResolver); + return StrategyResolver; +}()); +var Lazy = (function () { + function Lazy(key) { + this._key = key; + } + Lazy_1 = Lazy; + Lazy.prototype.get = function (container) { + var _this = this; + return function () { return container.get(_this._key); }; + }; + Lazy.of = function (key) { + return new Lazy_1(key); + }; + var Lazy_1; + Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Lazy); + return Lazy; +}()); +var All = (function () { + function All(key) { + this._key = key; + } + All_1 = All; + All.prototype.get = function (container) { + return container.getAll(this._key); + }; + All.of = function (key) { + return new All_1(key); + }; + var All_1; + All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], All); + return All; +}()); +var Optional = (function () { + function Optional(key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + this._key = key; + this._checkParent = checkParent; + } + Optional_1 = Optional; + Optional.prototype.get = function (container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + }; + Optional.of = function (key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + return new Optional_1(key, checkParent); + }; + var Optional_1; + Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], Optional); + return Optional; +}()); +var Parent = (function () { + function Parent(key) { + this._key = key; + } + Parent_1 = Parent; + Parent.prototype.get = function (container) { + return container.parent ? container.parent.get(this._key) : null; + }; + Parent.of = function (key) { + return new Parent_1(key); + }; + var Parent_1; + Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Parent); + return Parent; +}()); +var Factory = (function () { + function Factory(key) { + this._key = key; + } + Factory_1 = Factory; + Factory.prototype.get = function (container) { + var fn = this._key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === exports.Strategy.function) { + fn = resolver.state; + } + return function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return container.invoke(fn, rest); + }; + }; + Factory.of = function (key) { + return new Factory_1(key); + }; + var Factory_1; + Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Factory); + return Factory; +}()); +var NewInstance = (function () { + function NewInstance(key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + NewInstance_1 = NewInstance; + NewInstance.prototype.get = function (container) { + var dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(function (dependency) { + return dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency); + }) + : undefined; + var fn = this.key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + var instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + }; + NewInstance.prototype.as = function (key) { + this.asKey = key; + return this; + }; + NewInstance.of = function (key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + return new (NewInstance_1.bind.apply(NewInstance_1, __spreadArray([void 0, key], dynamicDependencies, false)))(); + }; + var NewInstance_1; + NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], NewInstance); + return NewInstance; +}()); +function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; +} +function lazy(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; +} +function all(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; +} +function optional(checkParentOrTarget) { + if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } + var deco = function (checkParent) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); +} +function parent(target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); +} +function factory(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; +} +function newInstance(asKeyOrTarget) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + var deco = function (asKey) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of.apply(NewInstance, __spreadArray([inject[index]], dynamicDependencies, false)); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); } -function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } -} -var _emptyParameters = Object.freeze([]); -aureliaMetadata.metadata.registration = 'aurelia:registration'; -aureliaMetadata.metadata.invoker = 'aurelia:invoker'; -var resolverDecorates = resolver.decorates; -var InvocationHandler = (function () { - function InvocationHandler(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - }; - return InvocationHandler; -}()); -function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - var lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); -} -var classInvoker = { - invoke: function (container, Type, deps) { - var instances = deps.map(function (dep) { return container.get(dep); }); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies: invokeWithDynamicDependencies -}; -function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; -} -var Container = (function () { - function Container(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - Container.prototype.makeGlobal = function () { - Container.instance = this; - return this; - }; - Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - }; - Container.prototype.registerInstance = function (key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - }; - Container.prototype.registerSingleton = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - }; - Container.prototype.registerTransient = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - }; - Container.prototype.registerHandler = function (key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - }; - Container.prototype.registerAlias = function (originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - }; - Container.prototype.registerResolver = function (key, resolver$$1) { - validateKey(key); - var allResolvers = this._resolvers; - var result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - }; - Container.prototype.autoRegister = function (key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - }; - Container.prototype.autoRegisterAll = function (fns) { - var i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - }; - Container.prototype.unregister = function (key) { - this._resolvers.delete(key); - }; - Container.prototype.hasResolver = function (key, checkParent) { - if (checkParent === void 0) { checkParent = false; } - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - }; - Container.prototype.getResolver = function (key) { - return this._resolvers.get(key); - }; - Container.prototype.get = function (key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - }; - Container.prototype._get = function (key) { - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - }; - Container.prototype.getAll = function (key) { - validateKey(key); - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - var state = resolver$$1.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - }; - Container.prototype.createChild = function () { - var child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - }; - Container.prototype.invoke = function (fn, dynamicDependencies) { - try { - var handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new aureliaPal.AggregateError("Error invoking " + fn.name + ". Check the inner error for details.", e, true); - } - }; - Container.prototype._createInvocationHandler = function (fn) { - var dependencies; - if (fn.inject === undefined) { - dependencies = - aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - var ctor = fn; - while (typeof ctor === 'function') { - dependencies.push.apply(dependencies, getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; - var handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - }; - return Container; +var currentContainer = null; +function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } +} +var _emptyParameters = Object.freeze([]); +aureliaMetadata.metadata.registration = 'aurelia:registration'; +aureliaMetadata.metadata.invoker = 'aurelia:invoker'; +var resolverDecorates = resolver.decorates; +var InvocationHandler = (function () { + function InvocationHandler(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { + var previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + }; + return InvocationHandler; }()); +function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + var lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); +} +var classInvoker = { + invoke: function (container, Type, deps) { + var instances = deps.map(function (dep) { return container.get(dep); }); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies: invokeWithDynamicDependencies +}; +function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; +} +var Container = (function () { + function Container(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + Container.prototype.makeGlobal = function () { + Container.instance = this; + return this; + }; + Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + }; + Container.prototype.registerInstance = function (key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + }; + Container.prototype.registerSingleton = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.singleton, fn === undefined ? key : fn)); + }; + Container.prototype.registerTransient = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + }; + Container.prototype.registerHandler = function (key, handler) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.function, handler)); + }; + Container.prototype.registerAlias = function (originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + }; + Container.prototype.registerResolver = function (key, resolver) { + validateKey(key); + var allResolvers = this._resolvers; + var result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + }; + Container.prototype.autoRegister = function (key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + }; + Container.prototype.autoRegisterAll = function (fns) { + var i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + }; + Container.prototype.unregister = function (key) { + this._resolvers.delete(key); + }; + Container.prototype.hasResolver = function (key, checkParent) { + if (checkParent === void 0) { checkParent = false; } + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + }; + Container.prototype.getResolver = function (key) { + return this._resolvers.get(key); + }; + Container.prototype.get = function (key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + }; + Container.prototype._get = function (key) { + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + }; + Container.prototype.getAll = function (key) { + validateKey(key); + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + var state = resolver.state; + var i = state.length; + var results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + }; + Container.prototype.createChild = function () { + var child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + }; + Container.prototype.invoke = function (fn, dynamicDependencies) { + try { + var handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new aureliaPal.AggregateError("Error invoking ".concat(fn.name, ". Check the inner error for details."), e, true); + } + }; + Container.prototype._createInvocationHandler = function (fn) { + var dependencies; + if (fn.inject === undefined) { + dependencies = + aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + var ctor = fn; + while (typeof ctor === 'function') { + dependencies.push.apply(dependencies, getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; + var handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + }; + return Container; +}()); +function resolve() { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + if (currentContainer == null) { + throw new Error("There is not a currently active container to resolve \"".concat(String(keys), "\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?")); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); +} +function containerGetKey(key) { + return this.get(key); +} -function invoker(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); - }; -} -function invokeAsFactory(potentialTarget) { - var deco = function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; -} -var FactoryInvoker = (function () { - function FactoryInvoker() { - } - FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { - var i = dependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - }; - FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - }; - return FactoryInvoker; -}()); +function invoker(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); + }; +} +function invokeAsFactory(potentialTarget) { + var deco = function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; +} +var FactoryInvoker = (function () { + function FactoryInvoker() { + } + FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { + var i = dependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + }; + FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + }; + return FactoryInvoker; +}()); FactoryInvoker.instance = new FactoryInvoker(); -function registration(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); - }; -} -function transient(key) { - return registration(new TransientRegistration(key)); -} -function singleton(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); -} -var TransientRegistration = (function () { - function TransientRegistration(key) { - this._key = key; - } - TransientRegistration.prototype.registerResolver = function (container, key, fn) { - var existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - }; - return TransientRegistration; -}()); -var SingletonRegistration = (function () { - function SingletonRegistration(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - SingletonRegistration.prototype.registerResolver = function (container, key, fn) { - var targetContainer = this._registerInChild ? container : container.root; - var existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - }; - return SingletonRegistration; +function registration(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); + }; +} +function transient(key) { + return registration(new TransientRegistration(key)); +} +function singleton(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); +} +var TransientRegistration = (function () { + function TransientRegistration(key) { + this._key = key; + } + TransientRegistration.prototype.registerResolver = function (container, key, fn) { + var existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + }; + return TransientRegistration; +}()); +var SingletonRegistration = (function () { + function SingletonRegistration(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + SingletonRegistration.prototype.registerResolver = function (container, key, fn) { + var targetContainer = this._registerInChild ? container : container.root; + var existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + }; + return SingletonRegistration; }()); -exports._emptyParameters = _emptyParameters; -exports.InvocationHandler = InvocationHandler; +exports.All = All; exports.Container = Container; -exports.autoinject = autoinject; -exports.inject = inject; -exports.invoker = invoker; -exports.invokeAsFactory = invokeAsFactory; +exports.Factory = Factory; exports.FactoryInvoker = FactoryInvoker; -exports.registration = registration; -exports.transient = transient; -exports.singleton = singleton; -exports.TransientRegistration = TransientRegistration; -exports.SingletonRegistration = SingletonRegistration; -exports.resolver = resolver; -exports.StrategyResolver = StrategyResolver; +exports.InvocationHandler = InvocationHandler; exports.Lazy = Lazy; -exports.All = All; +exports.NewInstance = NewInstance; exports.Optional = Optional; exports.Parent = Parent; -exports.Factory = Factory; -exports.NewInstance = NewInstance; +exports.SingletonRegistration = SingletonRegistration; +exports.StrategyResolver = StrategyResolver; +exports.TransientRegistration = TransientRegistration; +exports._emptyParameters = _emptyParameters; +exports.all = all; +exports.autoinject = autoinject; +exports.factory = factory; exports.getDecoratorDependencies = getDecoratorDependencies; +exports.inject = inject; +exports.invokeAsFactory = invokeAsFactory; +exports.invoker = invoker; exports.lazy = lazy; -exports.all = all; +exports.newInstance = newInstance; exports.optional = optional; exports.parent = parent; -exports.factory = factory; -exports.newInstance = newInstance; +exports.registration = registration; +exports.resolve = resolve; +exports.resolver = resolver; +exports.singleton = singleton; +exports.transient = transient; +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/commonjs/aurelia-dependency-injection.js.map b/dist/commonjs/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..47a586b --- /dev/null +++ b/dist/commonjs/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":["metadata","protocol","Strategy","AggregateError"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsCA;AACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;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AAA,KAAA,KAAA,CAAA,EAAA,EAAA,eAAgC,GAAA,KAAA,CAAA,EAAA;AAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;AAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;SAC9C;aAAM;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;AACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;SACzC;KACF;AASM,IAAA,qBAAA,CAAA,SAAA,CAAA,gBAAgB,GAAvB,UACE,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;AAEhD,QAAA,IAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AAC3E,QAAA,IAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;QACvE,OAAO,gBAAgB,KAAK,SAAS;AACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;cACvD,gBAAgB,CAAC;KACtB,CAAA;IACH,OAAC,qBAAA,CAAA;AAAD,CAAC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/es2015/aurelia-dependency-injection.js b/dist/es2015/aurelia-dependency-injection.js index 765f393..1b8976d 100644 --- a/dist/es2015/aurelia-dependency-injection.js +++ b/dist/es2015/aurelia-dependency-injection.js @@ -1,20 +1,22 @@ import { metadata, protocol } from 'aurelia-metadata'; import { AggregateError } from 'aurelia-pal'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 +/****************************************************************************** +Copyright (c) Microsoft Corporation. -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -25,574 +27,599 @@ function __decorate(decorators, target, key, desc) { function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function isInjectable(potentialTarget) { - return !!potentialTarget; } -function autoinject(potentialTarget) { - const deco = (target) => { - if (!target.hasOwnProperty('inject')) { - target.inject = (metadata.getOwn(metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; -} -function inject(...rest) { - return (target, _key, descriptor) => { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - const fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function isInjectable(potentialTarget) { + return !!potentialTarget; +} +function autoinject(potentialTarget) { + const deco = (target) => { + if (!target.hasOwnProperty('inject')) { + target.inject = (metadata.getOwn(metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; +} +function inject(...rest) { + return (target, _key, descriptor) => { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + const fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; } -var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; -const resolver = protocol.create('aurelia:resolver', (target) => { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; -}); -var Strategy; -(function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; -})(Strategy || (Strategy = {})); -function isStrategy(actual, expected, state) { - return actual === expected; -} -let StrategyResolver = class StrategyResolver { - constructor(strategy, state) { - this.strategy = strategy; - this.state = state; - } - get(container, key) { - if (isStrategy(this.strategy, Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, Strategy.singleton, this.state)) { - const singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - } -}; -StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) -], StrategyResolver); -let Lazy = Lazy_1 = class Lazy { - constructor(key) { - this._key = key; - } - get(container) { - return () => container.get(this._key); - } - static of(key) { - return new Lazy_1(key); - } -}; -Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Lazy); -let All = All_1 = class All { - constructor(key) { - this._key = key; - } - get(container) { - return container.getAll(this._key); - } - static of(key) { - return new All_1(key); - } -}; -All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], All); -let Optional = Optional_1 = class Optional { - constructor(key, checkParent = true) { - this._key = key; - this._checkParent = checkParent; - } - get(container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - } - static of(key, checkParent = true) { - return new Optional_1(key, checkParent); - } -}; -Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) -], Optional); -let Parent = Parent_1 = class Parent { - constructor(key) { - this._key = key; - } - get(container) { - return container.parent ? container.parent.get(this._key) : null; - } - static of(key) { - return new Parent_1(key); - } -}; -Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Parent); -let Factory = Factory_1 = class Factory { - constructor(key) { - this._key = key; - } - get(container) { - let fn = this._key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === Strategy.function) { - fn = resolver.state; - } - return (...rest) => container.invoke(fn, rest); - } - static of(key) { - return new Factory_1(key); - } -}; -Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Factory); -let NewInstance = NewInstance_1 = class NewInstance { - constructor(key, ...dynamicDependencies) { - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - get(container) { - const dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency)) - : undefined; - let fn = this.key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - const instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - } - as(key) { - this.asKey = key; - return this; - } - static of(key, ...dynamicDependencies) { - return new NewInstance_1(key, ...dynamicDependencies); - } -}; -NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) -], NewInstance); -function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; -} -function lazy(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; -} -function all(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; -} -function optional(checkParentOrTarget = true) { - const deco = (checkParent) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); -} -function parent(target, _key, index) { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); -} -function factory(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; -} -function newInstance(asKeyOrTarget, ...dynamicDependencies) { - const deco = (asKey) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of(inject$$1[index], ...dynamicDependencies); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); +var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; +const resolver = protocol.create('aurelia:resolver', (target) => { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; +}); +var Strategy; +(function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; +})(Strategy || (Strategy = {})); +function isStrategy(actual, expected, state) { + return actual === expected; +} +let StrategyResolver = class StrategyResolver { + constructor(strategy, state) { + this.strategy = strategy; + this.state = state; + } + get(container, key) { + if (isStrategy(this.strategy, Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, Strategy.singleton, this.state)) { + const singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + } +}; +StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) +], StrategyResolver); +let Lazy = Lazy_1 = class Lazy { + constructor(key) { + this._key = key; + } + get(container) { + return () => container.get(this._key); + } + static of(key) { + return new Lazy_1(key); + } +}; +Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Lazy); +let All = All_1 = class All { + constructor(key) { + this._key = key; + } + get(container) { + return container.getAll(this._key); + } + static of(key) { + return new All_1(key); + } +}; +All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], All); +let Optional = Optional_1 = class Optional { + constructor(key, checkParent = true) { + this._key = key; + this._checkParent = checkParent; + } + get(container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + } + static of(key, checkParent = true) { + return new Optional_1(key, checkParent); + } +}; +Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) +], Optional); +let Parent = Parent_1 = class Parent { + constructor(key) { + this._key = key; + } + get(container) { + return container.parent ? container.parent.get(this._key) : null; + } + static of(key) { + return new Parent_1(key); + } +}; +Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Parent); +let Factory = Factory_1 = class Factory { + constructor(key) { + this._key = key; + } + get(container) { + let fn = this._key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === Strategy.function) { + fn = resolver.state; + } + return (...rest) => container.invoke(fn, rest); + } + static of(key) { + return new Factory_1(key); + } +}; +Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Factory); +let NewInstance = NewInstance_1 = class NewInstance { + constructor(key, ...dynamicDependencies) { + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + get(container) { + const dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency)) + : undefined; + let fn = this.key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + const instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + } + as(key) { + this.asKey = key; + return this; + } + static of(key, ...dynamicDependencies) { + return new NewInstance_1(key, ...dynamicDependencies); + } +}; +NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) +], NewInstance); +function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; +} +function lazy(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; +} +function all(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; +} +function optional(checkParentOrTarget = true) { + const deco = (checkParent) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); +} +function parent(target, _key, index) { + const inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); +} +function factory(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; +} +function newInstance(asKeyOrTarget, ...dynamicDependencies) { + const deco = (asKey) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of(inject[index], ...dynamicDependencies); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); } -function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } -} -const _emptyParameters = Object.freeze([]); -metadata.registration = 'aurelia:registration'; -metadata.invoker = 'aurelia:invoker'; -const resolverDecorates = resolver.decorates; -class InvocationHandler { - constructor(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - invoke(container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - } -} -function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - let lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); -} -const classInvoker = { - invoke(container, Type, deps) { - const instances = deps.map((dep) => container.get(dep)); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies -}; -function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; -} -class Container { - constructor(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - makeGlobal() { - Container.instance = this; - return this; - } - setHandlerCreatedCallback(onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - } - registerInstance(key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - } - registerSingleton(key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - } - registerTransient(key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - } - registerHandler(key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - } - registerAlias(originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - } - registerResolver(key, resolver$$1) { - validateKey(key); - const allResolvers = this._resolvers; - const result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - } - autoRegister(key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - const registration = metadata.get(metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - } - autoRegisterAll(fns) { - let i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - } - unregister(key) { - this._resolvers.delete(key); - } - hasResolver(key, checkParent = false) { - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - } - getResolver(key) { - return this._resolvers.get(key); - } - get(key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - const registration = metadata.get(metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - } - _get(key) { - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - } - getAll(key) { - validateKey(key); - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - const state = resolver$$1.state; - let i = state.length; - const results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - } - createChild() { - const child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - } - invoke(fn, dynamicDependencies) { - try { - let handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); - } - } - _createInvocationHandler(fn) { - let dependencies; - if (fn.inject === undefined) { - dependencies = - metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - let ctor = fn; - while (typeof ctor === 'function') { - dependencies.push(...getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; - const handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - } +let currentContainer = null; +function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } +} +const _emptyParameters = Object.freeze([]); +metadata.registration = 'aurelia:registration'; +metadata.invoker = 'aurelia:invoker'; +const resolverDecorates = resolver.decorates; +class InvocationHandler { + constructor(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + invoke(container, dynamicDependencies) { + const previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + } +} +function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + let lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); +} +const classInvoker = { + invoke(container, Type, deps) { + const instances = deps.map((dep) => container.get(dep)); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies +}; +function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; +} +class Container { + constructor(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + makeGlobal() { + Container.instance = this; + return this; + } + setHandlerCreatedCallback(onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + } + registerInstance(key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + } + registerSingleton(key, fn) { + return this.registerResolver(key, new StrategyResolver(Strategy.singleton, fn === undefined ? key : fn)); + } + registerTransient(key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + } + registerHandler(key, handler) { + return this.registerResolver(key, new StrategyResolver(Strategy.function, handler)); + } + registerAlias(originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + } + registerResolver(key, resolver) { + validateKey(key); + const allResolvers = this._resolvers; + const result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + } + autoRegister(key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + const registration = metadata.get(metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + } + autoRegisterAll(fns) { + let i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + } + unregister(key) { + this._resolvers.delete(key); + } + hasResolver(key, checkParent = false) { + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + } + getResolver(key) { + return this._resolvers.get(key); + } + get(key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + const registration = metadata.get(metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + } + _get(key) { + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + } + getAll(key) { + validateKey(key); + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + } + createChild() { + const child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + } + invoke(fn, dynamicDependencies) { + try { + let handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); + } + } + _createInvocationHandler(fn) { + let dependencies; + if (fn.inject === undefined) { + dependencies = + metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + let ctor = fn; + while (typeof ctor === 'function') { + dependencies.push(...getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; + const handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + } +} +function resolve(...keys) { + if (currentContainer == null) { + throw new Error(`There is not a currently active container to resolve "${String(keys)}". Are you trying to "new SomeClass(...)" that has a resolve(...) call?`); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); +} +function containerGetKey(key) { + return this.get(key); } -function invoker(value) { - return target => { - metadata.define(metadata.invoker, value, target); - }; -} -function invokeAsFactory(potentialTarget) { - const deco = (target) => { - metadata.define(metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; -} -class FactoryInvoker { - invoke(container, fn, dependencies) { - let i = dependencies.length; - const args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - } - invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - } -} +function invoker(value) { + return target => { + metadata.define(metadata.invoker, value, target); + }; +} +function invokeAsFactory(potentialTarget) { + const deco = (target) => { + metadata.define(metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; +} +class FactoryInvoker { + invoke(container, fn, dependencies) { + let i = dependencies.length; + const args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + } + invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + } +} FactoryInvoker.instance = new FactoryInvoker(); -function registration(value) { - return (target) => { - metadata.define(metadata.registration, value, target); - }; -} -function transient(key) { - return registration(new TransientRegistration(key)); -} -function singleton(keyOrRegisterInChild, registerInChild = false) { - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); -} -class TransientRegistration { - constructor(key) { - this._key = key; - } - registerResolver(container, key, fn) { - const existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - } -} -class SingletonRegistration { - constructor(keyOrRegisterInChild, registerInChild = false) { - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - registerResolver(container, key, fn) { - const targetContainer = this._registerInChild ? container : container.root; - const existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - } +function registration(value) { + return (target) => { + metadata.define(metadata.registration, value, target); + }; +} +function transient(key) { + return registration(new TransientRegistration(key)); +} +function singleton(keyOrRegisterInChild, registerInChild = false) { + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); +} +class TransientRegistration { + constructor(key) { + this._key = key; + } + registerResolver(container, key, fn) { + const existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + } +} +class SingletonRegistration { + constructor(keyOrRegisterInChild, registerInChild = false) { + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + registerResolver(container, key, fn) { + const targetContainer = this._registerInChild ? container : container.root; + const existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + } } -export { _emptyParameters, InvocationHandler, Container, autoinject, inject, invoker, invokeAsFactory, FactoryInvoker, registration, transient, singleton, TransientRegistration, SingletonRegistration, resolver, Strategy, StrategyResolver, Lazy, All, Optional, Parent, Factory, NewInstance, getDecoratorDependencies, lazy, all, optional, parent, factory, newInstance }; +export { All, Container, Factory, FactoryInvoker, InvocationHandler, Lazy, NewInstance, Optional, Parent, SingletonRegistration, Strategy, StrategyResolver, TransientRegistration, _emptyParameters, all, autoinject, factory, getDecoratorDependencies, inject, invokeAsFactory, invoker, lazy, newInstance, optional, parent, registration, resolve, resolver, singleton, transient }; +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/es2015/aurelia-dependency-injection.js.map b/dist/es2015/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..fcc6a08 --- /dev/null +++ b/dist/es2015/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsCA;AACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACnI,SAAS,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC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G,GACjB,EAAkD,CAAC;cACnD,gBAAgB,CAAC;KACtB;AACF,CAAA;MAMY,qBAAqB,CAAA;IAYhC,WACE,CAAA,oBAA+E,EAC/E,eAAA,GAA2B,KAAK,EAAA;AAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;AAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;SAC9C;aAAM;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;AACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;SACzC;KACF;AASM,IAAA,gBAAgB,CACrB,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;AAEhD,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AAC3E,QAAA,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;QACvE,OAAO,gBAAgB,KAAK,SAAS;AACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;cACvD,gBAAgB,CAAC;KACtB;AACF;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/es2017/aurelia-dependency-injection.js b/dist/es2017/aurelia-dependency-injection.js index 765f393..1b8976d 100644 --- a/dist/es2017/aurelia-dependency-injection.js +++ b/dist/es2017/aurelia-dependency-injection.js @@ -1,20 +1,22 @@ import { metadata, protocol } from 'aurelia-metadata'; import { AggregateError } from 'aurelia-pal'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 +/****************************************************************************** +Copyright (c) Microsoft Corporation. -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -25,574 +27,599 @@ function __decorate(decorators, target, key, desc) { function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function isInjectable(potentialTarget) { - return !!potentialTarget; } -function autoinject(potentialTarget) { - const deco = (target) => { - if (!target.hasOwnProperty('inject')) { - target.inject = (metadata.getOwn(metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; -} -function inject(...rest) { - return (target, _key, descriptor) => { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - const fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function isInjectable(potentialTarget) { + return !!potentialTarget; +} +function autoinject(potentialTarget) { + const deco = (target) => { + if (!target.hasOwnProperty('inject')) { + target.inject = (metadata.getOwn(metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; +} +function inject(...rest) { + return (target, _key, descriptor) => { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + const fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; } -var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; -const resolver = protocol.create('aurelia:resolver', (target) => { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; -}); -var Strategy; -(function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; -})(Strategy || (Strategy = {})); -function isStrategy(actual, expected, state) { - return actual === expected; -} -let StrategyResolver = class StrategyResolver { - constructor(strategy, state) { - this.strategy = strategy; - this.state = state; - } - get(container, key) { - if (isStrategy(this.strategy, Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, Strategy.singleton, this.state)) { - const singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - } -}; -StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) -], StrategyResolver); -let Lazy = Lazy_1 = class Lazy { - constructor(key) { - this._key = key; - } - get(container) { - return () => container.get(this._key); - } - static of(key) { - return new Lazy_1(key); - } -}; -Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Lazy); -let All = All_1 = class All { - constructor(key) { - this._key = key; - } - get(container) { - return container.getAll(this._key); - } - static of(key) { - return new All_1(key); - } -}; -All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], All); -let Optional = Optional_1 = class Optional { - constructor(key, checkParent = true) { - this._key = key; - this._checkParent = checkParent; - } - get(container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - } - static of(key, checkParent = true) { - return new Optional_1(key, checkParent); - } -}; -Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) -], Optional); -let Parent = Parent_1 = class Parent { - constructor(key) { - this._key = key; - } - get(container) { - return container.parent ? container.parent.get(this._key) : null; - } - static of(key) { - return new Parent_1(key); - } -}; -Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Parent); -let Factory = Factory_1 = class Factory { - constructor(key) { - this._key = key; - } - get(container) { - let fn = this._key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === Strategy.function) { - fn = resolver.state; - } - return (...rest) => container.invoke(fn, rest); - } - static of(key) { - return new Factory_1(key); - } -}; -Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) -], Factory); -let NewInstance = NewInstance_1 = class NewInstance { - constructor(key, ...dynamicDependencies) { - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - get(container) { - const dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency)) - : undefined; - let fn = this.key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - const instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - } - as(key) { - this.asKey = key; - return this; - } - static of(key, ...dynamicDependencies) { - return new NewInstance_1(key, ...dynamicDependencies); - } -}; -NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) -], NewInstance); -function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; -} -function lazy(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; -} -function all(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; -} -function optional(checkParentOrTarget = true) { - const deco = (checkParent) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); -} -function parent(target, _key, index) { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); -} -function factory(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; -} -function newInstance(asKeyOrTarget, ...dynamicDependencies) { - const deco = (asKey) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of(inject$$1[index], ...dynamicDependencies); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); +var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; +const resolver = protocol.create('aurelia:resolver', (target) => { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; +}); +var Strategy; +(function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; +})(Strategy || (Strategy = {})); +function isStrategy(actual, expected, state) { + return actual === expected; +} +let StrategyResolver = class StrategyResolver { + constructor(strategy, state) { + this.strategy = strategy; + this.state = state; + } + get(container, key) { + if (isStrategy(this.strategy, Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, Strategy.singleton, this.state)) { + const singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + } +}; +StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) +], StrategyResolver); +let Lazy = Lazy_1 = class Lazy { + constructor(key) { + this._key = key; + } + get(container) { + return () => container.get(this._key); + } + static of(key) { + return new Lazy_1(key); + } +}; +Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Lazy); +let All = All_1 = class All { + constructor(key) { + this._key = key; + } + get(container) { + return container.getAll(this._key); + } + static of(key) { + return new All_1(key); + } +}; +All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], All); +let Optional = Optional_1 = class Optional { + constructor(key, checkParent = true) { + this._key = key; + this._checkParent = checkParent; + } + get(container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + } + static of(key, checkParent = true) { + return new Optional_1(key, checkParent); + } +}; +Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) +], Optional); +let Parent = Parent_1 = class Parent { + constructor(key) { + this._key = key; + } + get(container) { + return container.parent ? container.parent.get(this._key) : null; + } + static of(key) { + return new Parent_1(key); + } +}; +Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Parent); +let Factory = Factory_1 = class Factory { + constructor(key) { + this._key = key; + } + get(container) { + let fn = this._key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === Strategy.function) { + fn = resolver.state; + } + return (...rest) => container.invoke(fn, rest); + } + static of(key) { + return new Factory_1(key); + } +}; +Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) +], Factory); +let NewInstance = NewInstance_1 = class NewInstance { + constructor(key, ...dynamicDependencies) { + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + get(container) { + const dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency)) + : undefined; + let fn = this.key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + const instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + } + as(key) { + this.asKey = key; + return this; + } + static of(key, ...dynamicDependencies) { + return new NewInstance_1(key, ...dynamicDependencies); + } +}; +NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) +], NewInstance); +function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; +} +function lazy(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; +} +function all(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; +} +function optional(checkParentOrTarget = true) { + const deco = (checkParent) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); +} +function parent(target, _key, index) { + const inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); +} +function factory(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; +} +function newInstance(asKeyOrTarget, ...dynamicDependencies) { + const deco = (asKey) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of(inject[index], ...dynamicDependencies); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); } -function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } -} -const _emptyParameters = Object.freeze([]); -metadata.registration = 'aurelia:registration'; -metadata.invoker = 'aurelia:invoker'; -const resolverDecorates = resolver.decorates; -class InvocationHandler { - constructor(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - invoke(container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - } -} -function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - let lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); -} -const classInvoker = { - invoke(container, Type, deps) { - const instances = deps.map((dep) => container.get(dep)); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies -}; -function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; -} -class Container { - constructor(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - makeGlobal() { - Container.instance = this; - return this; - } - setHandlerCreatedCallback(onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - } - registerInstance(key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - } - registerSingleton(key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - } - registerTransient(key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - } - registerHandler(key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - } - registerAlias(originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - } - registerResolver(key, resolver$$1) { - validateKey(key); - const allResolvers = this._resolvers; - const result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - } - autoRegister(key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - const registration = metadata.get(metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - } - autoRegisterAll(fns) { - let i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - } - unregister(key) { - this._resolvers.delete(key); - } - hasResolver(key, checkParent = false) { - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - } - getResolver(key) { - return this._resolvers.get(key); - } - get(key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - const registration = metadata.get(metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - } - _get(key) { - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - } - getAll(key) { - validateKey(key); - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - const state = resolver$$1.state; - let i = state.length; - const results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - } - createChild() { - const child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - } - invoke(fn, dynamicDependencies) { - try { - let handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); - } - } - _createInvocationHandler(fn) { - let dependencies; - if (fn.inject === undefined) { - dependencies = - metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - let ctor = fn; - while (typeof ctor === 'function') { - dependencies.push(...getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; - const handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - } +let currentContainer = null; +function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } +} +const _emptyParameters = Object.freeze([]); +metadata.registration = 'aurelia:registration'; +metadata.invoker = 'aurelia:invoker'; +const resolverDecorates = resolver.decorates; +class InvocationHandler { + constructor(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + invoke(container, dynamicDependencies) { + const previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + } +} +function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + let lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); +} +const classInvoker = { + invoke(container, Type, deps) { + const instances = deps.map((dep) => container.get(dep)); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies +}; +function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; +} +class Container { + constructor(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + makeGlobal() { + Container.instance = this; + return this; + } + setHandlerCreatedCallback(onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + } + registerInstance(key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + } + registerSingleton(key, fn) { + return this.registerResolver(key, new StrategyResolver(Strategy.singleton, fn === undefined ? key : fn)); + } + registerTransient(key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + } + registerHandler(key, handler) { + return this.registerResolver(key, new StrategyResolver(Strategy.function, handler)); + } + registerAlias(originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + } + registerResolver(key, resolver) { + validateKey(key); + const allResolvers = this._resolvers; + const result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + } + autoRegister(key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + const registration = metadata.get(metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + } + autoRegisterAll(fns) { + let i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + } + unregister(key) { + this._resolvers.delete(key); + } + hasResolver(key, checkParent = false) { + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + } + getResolver(key) { + return this._resolvers.get(key); + } + get(key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + const registration = metadata.get(metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + } + _get(key) { + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + } + getAll(key) { + validateKey(key); + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + } + createChild() { + const child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + } + invoke(fn, dynamicDependencies) { + try { + let handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); + } + } + _createInvocationHandler(fn) { + let dependencies; + if (fn.inject === undefined) { + dependencies = + metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + let ctor = fn; + while (typeof ctor === 'function') { + dependencies.push(...getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; + const handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + } +} +function resolve(...keys) { + if (currentContainer == null) { + throw new Error(`There is not a currently active container to resolve "${String(keys)}". Are you trying to "new SomeClass(...)" that has a resolve(...) call?`); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); +} +function containerGetKey(key) { + return this.get(key); } -function invoker(value) { - return target => { - metadata.define(metadata.invoker, value, target); - }; -} -function invokeAsFactory(potentialTarget) { - const deco = (target) => { - metadata.define(metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; -} -class FactoryInvoker { - invoke(container, fn, dependencies) { - let i = dependencies.length; - const args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - } - invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - } -} +function invoker(value) { + return target => { + metadata.define(metadata.invoker, value, target); + }; +} +function invokeAsFactory(potentialTarget) { + const deco = (target) => { + metadata.define(metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; +} +class FactoryInvoker { + invoke(container, fn, dependencies) { + let i = dependencies.length; + const args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + } + invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + } +} FactoryInvoker.instance = new FactoryInvoker(); -function registration(value) { - return (target) => { - metadata.define(metadata.registration, value, target); - }; -} -function transient(key) { - return registration(new TransientRegistration(key)); -} -function singleton(keyOrRegisterInChild, registerInChild = false) { - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); -} -class TransientRegistration { - constructor(key) { - this._key = key; - } - registerResolver(container, key, fn) { - const existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - } -} -class SingletonRegistration { - constructor(keyOrRegisterInChild, registerInChild = false) { - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - registerResolver(container, key, fn) { - const targetContainer = this._registerInChild ? container : container.root; - const existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - } +function registration(value) { + return (target) => { + metadata.define(metadata.registration, value, target); + }; +} +function transient(key) { + return registration(new TransientRegistration(key)); +} +function singleton(keyOrRegisterInChild, registerInChild = false) { + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); +} +class TransientRegistration { + constructor(key) { + this._key = key; + } + registerResolver(container, key, fn) { + const existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + } +} +class SingletonRegistration { + constructor(keyOrRegisterInChild, registerInChild = false) { + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + registerResolver(container, key, fn) { + const targetContainer = this._registerInChild ? container : container.root; + const existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + } } -export { _emptyParameters, InvocationHandler, Container, autoinject, inject, invoker, invokeAsFactory, FactoryInvoker, registration, transient, singleton, TransientRegistration, SingletonRegistration, resolver, Strategy, StrategyResolver, Lazy, All, Optional, Parent, Factory, NewInstance, getDecoratorDependencies, lazy, all, optional, parent, factory, newInstance }; +export { All, Container, Factory, FactoryInvoker, InvocationHandler, Lazy, NewInstance, Optional, Parent, SingletonRegistration, Strategy, StrategyResolver, TransientRegistration, _emptyParameters, all, autoinject, factory, getDecoratorDependencies, inject, invokeAsFactory, invoker, lazy, newInstance, optional, parent, registration, resolve, resolver, singleton, transient }; +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/es2017/aurelia-dependency-injection.js.map b/dist/es2017/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..fcc6a08 --- /dev/null +++ b/dist/es2017/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsCA;AACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACnI,SAAS,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC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CAAC;KACtB;AACF,CAAA;MAMY,qBAAqB,CAAA;IAYhC,WACE,CAAA,oBAA+E,EAC/E,eAAA,GAA2B,KAAK,EAAA;AAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;AAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;SAC9C;aAAM;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;AACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;SACzC;KACF;AASM,IAAA,gBAAgB,CACrB,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;AAEhD,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AAC3E,QAAA,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;QACvE,OAAO,gBAAgB,KAAK,SAAS;AACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;cACvD,gBAAgB,CAAC;KACtB;AACF;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/native-modules/aurelia-dependency-injection.js b/dist/native-modules/aurelia-dependency-injection.js index 2437b42..534a5a3 100644 --- a/dist/native-modules/aurelia-dependency-injection.js +++ b/dist/native-modules/aurelia-dependency-injection.js @@ -1,20 +1,22 @@ import { metadata, protocol } from 'aurelia-metadata'; import { AggregateError } from 'aurelia-pal'; -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 +/****************************************************************************** +Copyright (c) Microsoft Corporation. -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol */ + function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; @@ -25,630 +27,669 @@ function __decorate(decorators, target, key, desc) { function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function isInjectable(potentialTarget) { - return !!potentialTarget; } -function autoinject(potentialTarget) { - var deco = function (target) { - if (!target.hasOwnProperty('inject')) { - target.inject = (metadata.getOwn(metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); } - return deco; + return to.concat(ar || Array.prototype.slice.call(from)); } -function inject() { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return function (target, _key, descriptor) { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - var fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; + +typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function isInjectable(potentialTarget) { + return !!potentialTarget; +} +function autoinject(potentialTarget) { + var deco = function (target) { + if (!target.hasOwnProperty('inject')) { + target.inject = (metadata.getOwn(metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; +} +function inject() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return function (target, _key, descriptor) { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + var fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; } -var resolver = protocol.create('aurelia:resolver', function (target) { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; -}); -var Strategy; -(function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; -})(Strategy || (Strategy = {})); -function isStrategy(actual, expected, state) { - return actual === expected; -} -var StrategyResolver = (function () { - function StrategyResolver(strategy, state) { - this.strategy = strategy; - this.state = state; - } - StrategyResolver.prototype.get = function (container, key) { - if (isStrategy(this.strategy, Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, Strategy.singleton, this.state)) { - var singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - }; - StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], StrategyResolver); - return StrategyResolver; -}()); -var Lazy = (function () { - function Lazy(key) { - this._key = key; - } - Lazy_1 = Lazy; - Lazy.prototype.get = function (container) { - var _this = this; - return function () { return container.get(_this._key); }; - }; - Lazy.of = function (key) { - return new Lazy_1(key); - }; - var Lazy_1; - Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Lazy); - return Lazy; -}()); -var All = (function () { - function All(key) { - this._key = key; - } - All_1 = All; - All.prototype.get = function (container) { - return container.getAll(this._key); - }; - All.of = function (key) { - return new All_1(key); - }; - var All_1; - All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], All); - return All; -}()); -var Optional = (function () { - function Optional(key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - this._key = key; - this._checkParent = checkParent; - } - Optional_1 = Optional; - Optional.prototype.get = function (container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - }; - Optional.of = function (key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - return new Optional_1(key, checkParent); - }; - var Optional_1; - Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], Optional); - return Optional; -}()); -var Parent = (function () { - function Parent(key) { - this._key = key; - } - Parent_1 = Parent; - Parent.prototype.get = function (container) { - return container.parent ? container.parent.get(this._key) : null; - }; - Parent.of = function (key) { - return new Parent_1(key); - }; - var Parent_1; - Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Parent); - return Parent; -}()); -var Factory = (function () { - function Factory(key) { - this._key = key; - } - Factory_1 = Factory; - Factory.prototype.get = function (container) { - var fn = this._key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === Strategy.function) { - fn = resolver.state; - } - return function () { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return container.invoke(fn, rest); - }; - }; - Factory.of = function (key) { - return new Factory_1(key); - }; - var Factory_1; - Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Factory); - return Factory; -}()); -var NewInstance = (function () { - function NewInstance(key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - NewInstance_1 = NewInstance; - NewInstance.prototype.get = function (container) { - var dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(function (dependency) { - return dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency); - }) - : undefined; - var fn = this.key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - var instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - }; - NewInstance.prototype.as = function (key) { - this.asKey = key; - return this; - }; - NewInstance.of = function (key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))(); - }; - var NewInstance_1; - NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], NewInstance); - return NewInstance; -}()); -function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; -} -function lazy(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; -} -function all(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; -} -function optional(checkParentOrTarget) { - if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } - var deco = function (checkParent) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); -} -function parent(target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); -} -function factory(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; -} -function newInstance(asKeyOrTarget) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - var deco = function (asKey) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies)); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); +var resolver = protocol.create('aurelia:resolver', function (target) { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; +}); +var Strategy; +(function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; +})(Strategy || (Strategy = {})); +function isStrategy(actual, expected, state) { + return actual === expected; +} +var StrategyResolver = (function () { + function StrategyResolver(strategy, state) { + this.strategy = strategy; + this.state = state; + } + StrategyResolver.prototype.get = function (container, key) { + if (isStrategy(this.strategy, Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, Strategy.singleton, this.state)) { + var singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + }; + StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], StrategyResolver); + return StrategyResolver; +}()); +var Lazy = (function () { + function Lazy(key) { + this._key = key; + } + Lazy_1 = Lazy; + Lazy.prototype.get = function (container) { + var _this = this; + return function () { return container.get(_this._key); }; + }; + Lazy.of = function (key) { + return new Lazy_1(key); + }; + var Lazy_1; + Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Lazy); + return Lazy; +}()); +var All = (function () { + function All(key) { + this._key = key; + } + All_1 = All; + All.prototype.get = function (container) { + return container.getAll(this._key); + }; + All.of = function (key) { + return new All_1(key); + }; + var All_1; + All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], All); + return All; +}()); +var Optional = (function () { + function Optional(key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + this._key = key; + this._checkParent = checkParent; + } + Optional_1 = Optional; + Optional.prototype.get = function (container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + }; + Optional.of = function (key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + return new Optional_1(key, checkParent); + }; + var Optional_1; + Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], Optional); + return Optional; +}()); +var Parent = (function () { + function Parent(key) { + this._key = key; + } + Parent_1 = Parent; + Parent.prototype.get = function (container) { + return container.parent ? container.parent.get(this._key) : null; + }; + Parent.of = function (key) { + return new Parent_1(key); + }; + var Parent_1; + Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Parent); + return Parent; +}()); +var Factory = (function () { + function Factory(key) { + this._key = key; + } + Factory_1 = Factory; + Factory.prototype.get = function (container) { + var fn = this._key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === Strategy.function) { + fn = resolver.state; + } + return function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return container.invoke(fn, rest); + }; + }; + Factory.of = function (key) { + return new Factory_1(key); + }; + var Factory_1; + Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Factory); + return Factory; +}()); +var NewInstance = (function () { + function NewInstance(key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + NewInstance_1 = NewInstance; + NewInstance.prototype.get = function (container) { + var dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(function (dependency) { + return dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency); + }) + : undefined; + var fn = this.key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + var instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + }; + NewInstance.prototype.as = function (key) { + this.asKey = key; + return this; + }; + NewInstance.of = function (key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + return new (NewInstance_1.bind.apply(NewInstance_1, __spreadArray([void 0, key], dynamicDependencies, false)))(); + }; + var NewInstance_1; + NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], NewInstance); + return NewInstance; +}()); +function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; +} +function lazy(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; +} +function all(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; +} +function optional(checkParentOrTarget) { + if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } + var deco = function (checkParent) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); +} +function parent(target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); +} +function factory(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; +} +function newInstance(asKeyOrTarget) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + var deco = function (asKey) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of.apply(NewInstance, __spreadArray([inject[index]], dynamicDependencies, false)); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); } -function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } -} -var _emptyParameters = Object.freeze([]); -metadata.registration = 'aurelia:registration'; -metadata.invoker = 'aurelia:invoker'; -var resolverDecorates = resolver.decorates; -var InvocationHandler = (function () { - function InvocationHandler(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - }; - return InvocationHandler; -}()); -function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - var lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); -} -var classInvoker = { - invoke: function (container, Type, deps) { - var instances = deps.map(function (dep) { return container.get(dep); }); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies: invokeWithDynamicDependencies -}; -function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; -} -var Container = (function () { - function Container(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - Container.prototype.makeGlobal = function () { - Container.instance = this; - return this; - }; - Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - }; - Container.prototype.registerInstance = function (key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - }; - Container.prototype.registerSingleton = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - }; - Container.prototype.registerTransient = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - }; - Container.prototype.registerHandler = function (key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - }; - Container.prototype.registerAlias = function (originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - }; - Container.prototype.registerResolver = function (key, resolver$$1) { - validateKey(key); - var allResolvers = this._resolvers; - var result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - }; - Container.prototype.autoRegister = function (key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - var registration = metadata.get(metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - }; - Container.prototype.autoRegisterAll = function (fns) { - var i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - }; - Container.prototype.unregister = function (key) { - this._resolvers.delete(key); - }; - Container.prototype.hasResolver = function (key, checkParent) { - if (checkParent === void 0) { checkParent = false; } - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - }; - Container.prototype.getResolver = function (key) { - return this._resolvers.get(key); - }; - Container.prototype.get = function (key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - var registration = metadata.get(metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - }; - Container.prototype._get = function (key) { - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - }; - Container.prototype.getAll = function (key) { - validateKey(key); - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - var state = resolver$$1.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - }; - Container.prototype.createChild = function () { - var child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - }; - Container.prototype.invoke = function (fn, dynamicDependencies) { - try { - var handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new AggregateError("Error invoking " + fn.name + ". Check the inner error for details.", e, true); - } - }; - Container.prototype._createInvocationHandler = function (fn) { - var dependencies; - if (fn.inject === undefined) { - dependencies = - metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - var ctor = fn; - while (typeof ctor === 'function') { - dependencies.push.apply(dependencies, getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - var invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; - var handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - }; - return Container; +var currentContainer = null; +function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } +} +var _emptyParameters = Object.freeze([]); +metadata.registration = 'aurelia:registration'; +metadata.invoker = 'aurelia:invoker'; +var resolverDecorates = resolver.decorates; +var InvocationHandler = (function () { + function InvocationHandler(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { + var previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + }; + return InvocationHandler; }()); +function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + var lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); +} +var classInvoker = { + invoke: function (container, Type, deps) { + var instances = deps.map(function (dep) { return container.get(dep); }); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies: invokeWithDynamicDependencies +}; +function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; +} +var Container = (function () { + function Container(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + Container.prototype.makeGlobal = function () { + Container.instance = this; + return this; + }; + Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + }; + Container.prototype.registerInstance = function (key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + }; + Container.prototype.registerSingleton = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(Strategy.singleton, fn === undefined ? key : fn)); + }; + Container.prototype.registerTransient = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + }; + Container.prototype.registerHandler = function (key, handler) { + return this.registerResolver(key, new StrategyResolver(Strategy.function, handler)); + }; + Container.prototype.registerAlias = function (originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + }; + Container.prototype.registerResolver = function (key, resolver) { + validateKey(key); + var allResolvers = this._resolvers; + var result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + }; + Container.prototype.autoRegister = function (key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + var registration = metadata.get(metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + }; + Container.prototype.autoRegisterAll = function (fns) { + var i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + }; + Container.prototype.unregister = function (key) { + this._resolvers.delete(key); + }; + Container.prototype.hasResolver = function (key, checkParent) { + if (checkParent === void 0) { checkParent = false; } + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + }; + Container.prototype.getResolver = function (key) { + return this._resolvers.get(key); + }; + Container.prototype.get = function (key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + var registration = metadata.get(metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + }; + Container.prototype._get = function (key) { + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + }; + Container.prototype.getAll = function (key) { + validateKey(key); + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + var state = resolver.state; + var i = state.length; + var results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + }; + Container.prototype.createChild = function () { + var child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + }; + Container.prototype.invoke = function (fn, dynamicDependencies) { + try { + var handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new AggregateError("Error invoking ".concat(fn.name, ". Check the inner error for details."), e, true); + } + }; + Container.prototype._createInvocationHandler = function (fn) { + var dependencies; + if (fn.inject === undefined) { + dependencies = + metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + var ctor = fn; + while (typeof ctor === 'function') { + dependencies.push.apply(dependencies, getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + var invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; + var handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + }; + return Container; +}()); +function resolve() { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + if (currentContainer == null) { + throw new Error("There is not a currently active container to resolve \"".concat(String(keys), "\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?")); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); +} +function containerGetKey(key) { + return this.get(key); +} -function invoker(value) { - return function (target) { - metadata.define(metadata.invoker, value, target); - }; -} -function invokeAsFactory(potentialTarget) { - var deco = function (target) { - metadata.define(metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; -} -var FactoryInvoker = (function () { - function FactoryInvoker() { - } - FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { - var i = dependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - }; - FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - }; - return FactoryInvoker; -}()); +function invoker(value) { + return function (target) { + metadata.define(metadata.invoker, value, target); + }; +} +function invokeAsFactory(potentialTarget) { + var deco = function (target) { + metadata.define(metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; +} +var FactoryInvoker = (function () { + function FactoryInvoker() { + } + FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { + var i = dependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + }; + FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + }; + return FactoryInvoker; +}()); FactoryInvoker.instance = new FactoryInvoker(); -function registration(value) { - return function (target) { - metadata.define(metadata.registration, value, target); - }; -} -function transient(key) { - return registration(new TransientRegistration(key)); -} -function singleton(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); -} -var TransientRegistration = (function () { - function TransientRegistration(key) { - this._key = key; - } - TransientRegistration.prototype.registerResolver = function (container, key, fn) { - var existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - }; - return TransientRegistration; -}()); -var SingletonRegistration = (function () { - function SingletonRegistration(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - SingletonRegistration.prototype.registerResolver = function (container, key, fn) { - var targetContainer = this._registerInChild ? container : container.root; - var existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - }; - return SingletonRegistration; +function registration(value) { + return function (target) { + metadata.define(metadata.registration, value, target); + }; +} +function transient(key) { + return registration(new TransientRegistration(key)); +} +function singleton(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); +} +var TransientRegistration = (function () { + function TransientRegistration(key) { + this._key = key; + } + TransientRegistration.prototype.registerResolver = function (container, key, fn) { + var existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + }; + return TransientRegistration; +}()); +var SingletonRegistration = (function () { + function SingletonRegistration(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + SingletonRegistration.prototype.registerResolver = function (container, key, fn) { + var targetContainer = this._registerInChild ? container : container.root; + var existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + }; + return SingletonRegistration; }()); -export { _emptyParameters, InvocationHandler, Container, autoinject, inject, invoker, invokeAsFactory, FactoryInvoker, registration, transient, singleton, TransientRegistration, SingletonRegistration, resolver, Strategy, StrategyResolver, Lazy, All, Optional, Parent, Factory, NewInstance, getDecoratorDependencies, lazy, all, optional, parent, factory, newInstance }; +export { All, Container, Factory, FactoryInvoker, InvocationHandler, Lazy, NewInstance, Optional, Parent, SingletonRegistration, Strategy, StrategyResolver, TransientRegistration, _emptyParameters, all, autoinject, factory, getDecoratorDependencies, inject, invokeAsFactory, invoker, lazy, newInstance, optional, parent, registration, resolve, resolver, singleton, transient }; +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/native-modules/aurelia-dependency-injection.js.map b/dist/native-modules/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..4e9d0f0 --- /dev/null +++ b/dist/native-modules/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsCA;AACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,K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gBAAgB,GAAG,oBAAoB,CAAC;SAC9C;aAAM;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;AACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;SACzC;KACF;AASM,IAAA,qBAAA,CAAA,SAAA,CAAA,gBAAgB,GAAvB,UACE,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;AAEhD,QAAA,IAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;AAC3E,QAAA,IAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;QACvE,OAAO,gBAAgB,KAAK,SAAS;AACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;cACvD,gBAAgB,CAAC;KACtB,CAAA;IACH,OAAC,qBAAA,CAAA;AAAD,CAAC,EAAA;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/system/aurelia-dependency-injection.js b/dist/system/aurelia-dependency-injection.js index c6063a4..3e209c2 100644 --- a/dist/system/aurelia-dependency-injection.js +++ b/dist/system/aurelia-dependency-injection.js @@ -1,683 +1,724 @@ -System.register(['aurelia-metadata', 'aurelia-pal'], function (exports, module) { - 'use strict'; - var metadata, protocol, AggregateError; - return { - setters: [function (module) { - metadata = module.metadata; - protocol = module.protocol; - }, function (module) { - AggregateError = module.AggregateError; - }], - execute: function () { +System.register(['aurelia-metadata', 'aurelia-pal'], (function (exports) { + 'use strict'; + var metadata, protocol, AggregateError; + return { + setters: [function (module) { + metadata = module.metadata; + protocol = module.protocol; + }, function (module) { + AggregateError = module.AggregateError; + }], + execute: (function () { - exports({ - autoinject: autoinject, - inject: inject, - invoker: invoker, - invokeAsFactory: invokeAsFactory, - registration: registration, - transient: transient, - singleton: singleton, - Strategy: void 0, - getDecoratorDependencies: getDecoratorDependencies, - lazy: lazy, - all: all, - optional: optional, - parent: parent, - factory: factory, - newInstance: newInstance - }); + exports({ + all: all, + autoinject: autoinject, + factory: factory, + getDecoratorDependencies: getDecoratorDependencies, + inject: inject, + invokeAsFactory: invokeAsFactory, + invoker: invoker, + lazy: lazy, + newInstance: newInstance, + optional: optional, + parent: parent, + registration: registration, + resolve: resolve, + singleton: singleton, + transient: transient + }); - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + /****************************************************************************** + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - } + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; - function isInjectable(potentialTarget) { - return !!potentialTarget; - } - function autoinject(potentialTarget) { - var deco = function (target) { - if (!target.hasOwnProperty('inject')) { - target.inject = (metadata.getOwn(metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; - } - function inject() { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return function (target, _key, descriptor) { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - var fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; - } + function isInjectable(potentialTarget) { + return !!potentialTarget; + } + function autoinject(potentialTarget) { + var deco = function (target) { + if (!target.hasOwnProperty('inject')) { + target.inject = (metadata.getOwn(metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; + } + function inject() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return function (target, _key, descriptor) { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + var fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; + } - var resolver = exports('resolver', protocol.create('aurelia:resolver', function (target) { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; - })); - var Strategy; - (function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; - })(Strategy || (Strategy = exports('Strategy', {}))); - function isStrategy(actual, expected, state) { - return actual === expected; - } - var StrategyResolver = exports('StrategyResolver', (function () { - function StrategyResolver(strategy, state) { - this.strategy = strategy; - this.state = state; - } - StrategyResolver.prototype.get = function (container, key) { - if (isStrategy(this.strategy, Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, Strategy.singleton, this.state)) { - var singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - }; - StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], StrategyResolver); - return StrategyResolver; - }())); - var Lazy = exports('Lazy', (function () { - function Lazy(key) { - this._key = key; - } - Lazy_1 = Lazy; - Lazy.prototype.get = function (container) { - var _this = this; - return function () { return container.get(_this._key); }; - }; - Lazy.of = function (key) { - return new Lazy_1(key); - }; - var Lazy_1; - Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Lazy); - return Lazy; - }())); - var All = exports('All', (function () { - function All(key) { - this._key = key; - } - All_1 = All; - All.prototype.get = function (container) { - return container.getAll(this._key); - }; - All.of = function (key) { - return new All_1(key); - }; - var All_1; - All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], All); - return All; - }())); - var Optional = exports('Optional', (function () { - function Optional(key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - this._key = key; - this._checkParent = checkParent; - } - Optional_1 = Optional; - Optional.prototype.get = function (container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - }; - Optional.of = function (key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - return new Optional_1(key, checkParent); - }; - var Optional_1; - Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], Optional); - return Optional; - }())); - var Parent = exports('Parent', (function () { - function Parent(key) { - this._key = key; - } - Parent_1 = Parent; - Parent.prototype.get = function (container) { - return container.parent ? container.parent.get(this._key) : null; - }; - Parent.of = function (key) { - return new Parent_1(key); - }; - var Parent_1; - Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Parent); - return Parent; - }())); - var Factory = exports('Factory', (function () { - function Factory(key) { - this._key = key; - } - Factory_1 = Factory; - Factory.prototype.get = function (container) { - var fn = this._key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === Strategy.function) { - fn = resolver.state; - } - return function () { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return container.invoke(fn, rest); - }; - }; - Factory.of = function (key) { - return new Factory_1(key); - }; - var Factory_1; - Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Factory); - return Factory; - }())); - var NewInstance = exports('NewInstance', (function () { - function NewInstance(key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - NewInstance_1 = NewInstance; - NewInstance.prototype.get = function (container) { - var dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(function (dependency) { - return dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency); - }) - : undefined; - var fn = this.key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - var instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - }; - NewInstance.prototype.as = function (key) { - this.asKey = key; - return this; - }; - NewInstance.of = function (key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))(); - }; - var NewInstance_1; - NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], NewInstance); - return NewInstance; - }())); - function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; - } - function lazy(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; - } - function all(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; - } - function optional(checkParentOrTarget) { - if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } - var deco = function (checkParent) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); - } - function parent(target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); - } - function factory(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; - } - function newInstance(asKeyOrTarget) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - var deco = function (asKey) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies)); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); - } + var resolver = exports("resolver", protocol.create('aurelia:resolver', function (target) { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; + })); + var Strategy; exports("Strategy", Strategy); + (function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; + })(Strategy || (exports("Strategy", Strategy = {}))); + function isStrategy(actual, expected, state) { + return actual === expected; + } + var StrategyResolver = exports("StrategyResolver", (function () { + function StrategyResolver(strategy, state) { + this.strategy = strategy; + this.state = state; + } + StrategyResolver.prototype.get = function (container, key) { + if (isStrategy(this.strategy, Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, Strategy.singleton, this.state)) { + var singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + }; + StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], StrategyResolver); + return StrategyResolver; + }())); + var Lazy = exports("Lazy", (function () { + function Lazy(key) { + this._key = key; + } + Lazy_1 = Lazy; + Lazy.prototype.get = function (container) { + var _this = this; + return function () { return container.get(_this._key); }; + }; + Lazy.of = function (key) { + return new Lazy_1(key); + }; + var Lazy_1; + Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Lazy); + return Lazy; + }())); + var All = exports("All", (function () { + function All(key) { + this._key = key; + } + All_1 = All; + All.prototype.get = function (container) { + return container.getAll(this._key); + }; + All.of = function (key) { + return new All_1(key); + }; + var All_1; + All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], All); + return All; + }())); + var Optional = exports("Optional", (function () { + function Optional(key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + this._key = key; + this._checkParent = checkParent; + } + Optional_1 = Optional; + Optional.prototype.get = function (container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + }; + Optional.of = function (key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + return new Optional_1(key, checkParent); + }; + var Optional_1; + Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], Optional); + return Optional; + }())); + var Parent = exports("Parent", (function () { + function Parent(key) { + this._key = key; + } + Parent_1 = Parent; + Parent.prototype.get = function (container) { + return container.parent ? container.parent.get(this._key) : null; + }; + Parent.of = function (key) { + return new Parent_1(key); + }; + var Parent_1; + Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Parent); + return Parent; + }())); + var Factory = exports("Factory", (function () { + function Factory(key) { + this._key = key; + } + Factory_1 = Factory; + Factory.prototype.get = function (container) { + var fn = this._key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === Strategy.function) { + fn = resolver.state; + } + return function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return container.invoke(fn, rest); + }; + }; + Factory.of = function (key) { + return new Factory_1(key); + }; + var Factory_1; + Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Factory); + return Factory; + }())); + var NewInstance = exports("NewInstance", (function () { + function NewInstance(key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + NewInstance_1 = NewInstance; + NewInstance.prototype.get = function (container) { + var dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(function (dependency) { + return dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency); + }) + : undefined; + var fn = this.key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + var instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + }; + NewInstance.prototype.as = function (key) { + this.asKey = key; + return this; + }; + NewInstance.of = function (key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + return new (NewInstance_1.bind.apply(NewInstance_1, __spreadArray([void 0, key], dynamicDependencies, false)))(); + }; + var NewInstance_1; + NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], NewInstance); + return NewInstance; + }())); + function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; + } + function lazy(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; + } + function all(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; + } + function optional(checkParentOrTarget) { + if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } + var deco = function (checkParent) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); + } + function parent(target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); + } + function factory(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; + } + function newInstance(asKeyOrTarget) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + var deco = function (asKey) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of.apply(NewInstance, __spreadArray([inject[index]], dynamicDependencies, false)); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); + } - function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - } - var _emptyParameters = exports('_emptyParameters', Object.freeze([])); - metadata.registration = 'aurelia:registration'; - metadata.invoker = 'aurelia:invoker'; - var resolverDecorates = resolver.decorates; - var InvocationHandler = exports('InvocationHandler', (function () { - function InvocationHandler(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - }; - return InvocationHandler; - }())); - function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - var lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); - } - var classInvoker = { - invoke: function (container, Type, deps) { - var instances = deps.map(function (dep) { return container.get(dep); }); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies: invokeWithDynamicDependencies - }; - function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; - } - var Container = exports('Container', (function () { - function Container(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - Container.prototype.makeGlobal = function () { - Container.instance = this; - return this; - }; - Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - }; - Container.prototype.registerInstance = function (key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - }; - Container.prototype.registerSingleton = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - }; - Container.prototype.registerTransient = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - }; - Container.prototype.registerHandler = function (key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - }; - Container.prototype.registerAlias = function (originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - }; - Container.prototype.registerResolver = function (key, resolver$$1) { - validateKey(key); - var allResolvers = this._resolvers; - var result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - }; - Container.prototype.autoRegister = function (key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - var registration = metadata.get(metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - }; - Container.prototype.autoRegisterAll = function (fns) { - var i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - }; - Container.prototype.unregister = function (key) { - this._resolvers.delete(key); - }; - Container.prototype.hasResolver = function (key, checkParent) { - if (checkParent === void 0) { checkParent = false; } - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - }; - Container.prototype.getResolver = function (key) { - return this._resolvers.get(key); - }; - Container.prototype.get = function (key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - var registration = metadata.get(metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - }; - Container.prototype._get = function (key) { - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - }; - Container.prototype.getAll = function (key) { - validateKey(key); - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - var state = resolver$$1.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - }; - Container.prototype.createChild = function () { - var child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - }; - Container.prototype.invoke = function (fn, dynamicDependencies) { - try { - var handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new AggregateError("Error invoking " + fn.name + ". Check the inner error for details.", e, true); - } - }; - Container.prototype._createInvocationHandler = function (fn) { - var dependencies; - if (fn.inject === undefined) { - dependencies = - metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - var ctor = fn; - while (typeof ctor === 'function') { - dependencies.push.apply(dependencies, getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - var invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; - var handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - }; - return Container; - }())); + var currentContainer = null; + function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + } + var _emptyParameters = exports("_emptyParameters", Object.freeze([])); + metadata.registration = 'aurelia:registration'; + metadata.invoker = 'aurelia:invoker'; + var resolverDecorates = resolver.decorates; + var InvocationHandler = exports("InvocationHandler", (function () { + function InvocationHandler(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { + var previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + }; + return InvocationHandler; + }())); + function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + var lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); + } + var classInvoker = { + invoke: function (container, Type, deps) { + var instances = deps.map(function (dep) { return container.get(dep); }); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies: invokeWithDynamicDependencies + }; + function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; + } + var Container = exports("Container", (function () { + function Container(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + Container.prototype.makeGlobal = function () { + Container.instance = this; + return this; + }; + Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + }; + Container.prototype.registerInstance = function (key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + }; + Container.prototype.registerSingleton = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(Strategy.singleton, fn === undefined ? key : fn)); + }; + Container.prototype.registerTransient = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + }; + Container.prototype.registerHandler = function (key, handler) { + return this.registerResolver(key, new StrategyResolver(Strategy.function, handler)); + }; + Container.prototype.registerAlias = function (originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + }; + Container.prototype.registerResolver = function (key, resolver) { + validateKey(key); + var allResolvers = this._resolvers; + var result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + }; + Container.prototype.autoRegister = function (key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + var registration = metadata.get(metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + }; + Container.prototype.autoRegisterAll = function (fns) { + var i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + }; + Container.prototype.unregister = function (key) { + this._resolvers.delete(key); + }; + Container.prototype.hasResolver = function (key, checkParent) { + if (checkParent === void 0) { checkParent = false; } + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + }; + Container.prototype.getResolver = function (key) { + return this._resolvers.get(key); + }; + Container.prototype.get = function (key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + var registration = metadata.get(metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + }; + Container.prototype._get = function (key) { + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + }; + Container.prototype.getAll = function (key) { + validateKey(key); + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + var state = resolver.state; + var i = state.length; + var results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + }; + Container.prototype.createChild = function () { + var child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + }; + Container.prototype.invoke = function (fn, dynamicDependencies) { + try { + var handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new AggregateError("Error invoking ".concat(fn.name, ". Check the inner error for details."), e, true); + } + }; + Container.prototype._createInvocationHandler = function (fn) { + var dependencies; + if (fn.inject === undefined) { + dependencies = + metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + var ctor = fn; + while (typeof ctor === 'function') { + dependencies.push.apply(dependencies, getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + var invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker; + var handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + }; + return Container; + }())); + function resolve() { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + if (currentContainer == null) { + throw new Error("There is not a currently active container to resolve \"".concat(String(keys), "\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?")); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); + } + function containerGetKey(key) { + return this.get(key); + } - function invoker(value) { - return function (target) { - metadata.define(metadata.invoker, value, target); - }; - } - function invokeAsFactory(potentialTarget) { - var deco = function (target) { - metadata.define(metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; - } - var FactoryInvoker = exports('FactoryInvoker', (function () { - function FactoryInvoker() { - } - FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { - var i = dependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - }; - FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - }; - return FactoryInvoker; - }())); - FactoryInvoker.instance = new FactoryInvoker(); + function invoker(value) { + return function (target) { + metadata.define(metadata.invoker, value, target); + }; + } + function invokeAsFactory(potentialTarget) { + var deco = function (target) { + metadata.define(metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; + } + var FactoryInvoker = exports("FactoryInvoker", (function () { + function FactoryInvoker() { + } + FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { + var i = dependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + }; + FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + }; + return FactoryInvoker; + }())); + FactoryInvoker.instance = new FactoryInvoker(); - function registration(value) { - return function (target) { - metadata.define(metadata.registration, value, target); - }; - } - function transient(key) { - return registration(new TransientRegistration(key)); - } - function singleton(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); - } - var TransientRegistration = exports('TransientRegistration', (function () { - function TransientRegistration(key) { - this._key = key; - } - TransientRegistration.prototype.registerResolver = function (container, key, fn) { - var existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - }; - return TransientRegistration; - }())); - var SingletonRegistration = exports('SingletonRegistration', (function () { - function SingletonRegistration(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - SingletonRegistration.prototype.registerResolver = function (container, key, fn) { - var targetContainer = this._registerInChild ? container : container.root; - var existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - }; - return SingletonRegistration; - }())); + function registration(value) { + return function (target) { + metadata.define(metadata.registration, value, target); + }; + } + function transient(key) { + return registration(new TransientRegistration(key)); + } + function singleton(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); + } + var TransientRegistration = exports("TransientRegistration", (function () { + function TransientRegistration(key) { + this._key = key; + } + TransientRegistration.prototype.registerResolver = function (container, key, fn) { + var existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + }; + return TransientRegistration; + }())); + var SingletonRegistration = exports("SingletonRegistration", (function () { + function SingletonRegistration(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + SingletonRegistration.prototype.registerResolver = function (container, key, fn) { + var targetContainer = this._registerInChild ? container : container.root; + var existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + }; + return SingletonRegistration; + }())); - } - }; -}); + }) + }; +})); +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/system/aurelia-dependency-injection.js.map b/dist/system/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..5c3f9c0 --- /dev/null +++ b/dist/system/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAA;YACA;AACA;YACA;YACA;AACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;AACA;AAsCA;YACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;YAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;YACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YACnI,SAAS,KA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CAAA;gBACH,OAAC,qBAAA,CAAA;YAAD,CAAC,EAAA,GAAA;AAMD,gBAAA,qBAAA,oCAAA,CAAA,YAAA;gBAYE,SACE,qBAAA,CAAA,oBAA+E,EAC/E,eAAgC,EAAA;YAAhC,QAAA,IAAA,eAAA,KAAA,KAAA,CAAA,EAAA,EAAA,eAAgC,GAAA,KAAA,CAAA,EAAA;YAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;YAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;qBAC9C;yBAAM;YACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;YACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;qBACzC;iBACF;YASM,IAAA,qBAAA,CAAA,SAAA,CAAA,gBAAgB,GAAvB,UACE,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;YAEhD,QAAA,IAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;YAC3E,QAAA,IAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;oBACvE,OAAO,gBAAgB,KAAK,SAAS;YACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;0BACvD,gBAAgB,CAAC;iBACtB,CAAA;gBACH,OAAC,qBAAA,CAAA;YAAD,CAAC,EAAA;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/umd-es2015/aurelia-dependency-injection.js b/dist/umd-es2015/aurelia-dependency-injection.js index a32aa33..55642b2 100644 --- a/dist/umd-es2015/aurelia-dependency-injection.js +++ b/dist/umd-es2015/aurelia-dependency-injection.js @@ -1,624 +1,651 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('aurelia-metadata'), require('aurelia-pal')) : - typeof define === 'function' && define.amd ? define(['exports', 'aurelia-metadata', 'aurelia-pal'], factory) : - (factory((global.au = global.au || {}, global.au.validation = {}),global.aureliaMetadata,global.au)); -}(this, (function (exports,aureliaMetadata,aureliaPal) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('aurelia-metadata'), require('aurelia-pal')) : + typeof define === 'function' && define.amd ? define(['exports', 'aurelia-metadata', 'aurelia-pal'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.au = global.au || {}, global.au.validation = {}), global.au, global.au)); +})(this, (function (exports, aureliaMetadata, aureliaPal) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + /****************************************************************************** + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - } - - function isInjectable(potentialTarget) { - return !!potentialTarget; - } - function autoinject(potentialTarget) { - const deco = (target) => { - if (!target.hasOwnProperty('inject')) { - target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; - } - function inject(...rest) { - return (target, _key, descriptor) => { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - const fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; - } + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; - var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; - const resolver = aureliaMetadata.protocol.create('aurelia:resolver', (target) => { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; - }); - (function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; - })(exports.Strategy || (exports.Strategy = {})); - function isStrategy(actual, expected, state) { - return actual === expected; - } - exports.StrategyResolver = class StrategyResolver { - constructor(strategy, state) { - this.strategy = strategy; - this.state = state; - } - get(container, key) { - if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { - const singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - } - }; - exports.StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], exports.StrategyResolver); - exports.Lazy = Lazy_1 = class Lazy { - constructor(key) { - this._key = key; - } - get(container) { - return () => container.get(this._key); - } - static of(key) { - return new Lazy_1(key); - } - }; - exports.Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], exports.Lazy); - exports.All = All_1 = class All { - constructor(key) { - this._key = key; - } - get(container) { - return container.getAll(this._key); - } - static of(key) { - return new All_1(key); - } - }; - exports.All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], exports.All); - exports.Optional = Optional_1 = class Optional { - constructor(key, checkParent = true) { - this._key = key; - this._checkParent = checkParent; - } - get(container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - } - static of(key, checkParent = true) { - return new Optional_1(key, checkParent); - } - }; - exports.Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], exports.Optional); - exports.Parent = Parent_1 = class Parent { - constructor(key) { - this._key = key; - } - get(container) { - return container.parent ? container.parent.get(this._key) : null; - } - static of(key) { - return new Parent_1(key); - } - }; - exports.Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], exports.Parent); - exports.Factory = Factory_1 = class Factory { - constructor(key) { - this._key = key; - } - get(container) { - let fn = this._key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === exports.Strategy.function) { - fn = resolver.state; - } - return (...rest) => container.invoke(fn, rest); - } - static of(key) { - return new Factory_1(key); - } - }; - exports.Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], exports.Factory); - exports.NewInstance = NewInstance_1 = class NewInstance { - constructor(key, ...dynamicDependencies) { - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - get(container) { - const dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency)) - : undefined; - let fn = this.key; - const resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - const instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - } - as(key) { - this.asKey = key; - return this; - } - static of(key, ...dynamicDependencies) { - return new NewInstance_1(key, ...dynamicDependencies); - } - }; - exports.NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], exports.NewInstance); - function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; - } - function lazy(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.Lazy.of(keyValue); - }; - } - function all(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.All.of(keyValue); - }; - } - function optional(checkParentOrTarget = true) { - const deco = (checkParent) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); - } - function parent(target, _key, index) { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.Parent.of(inject$$1[index]); - } - function factory(keyValue) { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.Factory.of(keyValue); - }; - } - function newInstance(asKeyOrTarget, ...dynamicDependencies) { - const deco = (asKey) => { - return (target, _key, index) => { - const inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = exports.NewInstance.of(inject$$1[index], ...dynamicDependencies); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); - } + function isInjectable(potentialTarget) { + return !!potentialTarget; + } + function autoinject(potentialTarget) { + const deco = (target) => { + if (!target.hasOwnProperty('inject')) { + target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; + } + function inject(...rest) { + return (target, _key, descriptor) => { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + const fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; + } - function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - } - const _emptyParameters = Object.freeze([]); - aureliaMetadata.metadata.registration = 'aurelia:registration'; - aureliaMetadata.metadata.invoker = 'aurelia:invoker'; - const resolverDecorates = resolver.decorates; - class InvocationHandler { - constructor(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - invoke(container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - } - } - function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - let lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); - } - const classInvoker = { - invoke(container, Type, deps) { - const instances = deps.map((dep) => container.get(dep)); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies - }; - function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; - } - class Container { - constructor(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - makeGlobal() { - Container.instance = this; - return this; - } - setHandlerCreatedCallback(onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - } - registerInstance(key, instance) { - return this.registerResolver(key, new exports.StrategyResolver(0, instance === undefined ? key : instance)); - } - registerSingleton(key, fn) { - return this.registerResolver(key, new exports.StrategyResolver(1, fn === undefined ? key : fn)); - } - registerTransient(key, fn) { - return this.registerResolver(key, new exports.StrategyResolver(2, fn === undefined ? key : fn)); - } - registerHandler(key, handler) { - return this.registerResolver(key, new exports.StrategyResolver(3, handler)); - } - registerAlias(originalKey, aliasKey) { - return this.registerResolver(aliasKey, new exports.StrategyResolver(5, originalKey)); - } - registerResolver(key, resolver$$1) { - validateKey(key); - const allResolvers = this._resolvers; - const result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new exports.StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - } - autoRegister(key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - const registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new exports.StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new exports.StrategyResolver(0, fn)); - } - autoRegisterAll(fns) { - let i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - } - unregister(key) { - this._resolvers.delete(key); - } - hasResolver(key, checkParent = false) { - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - } - getResolver(key) { - return this._resolvers.get(key); - } - get(key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - const registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - } - _get(key) { - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - } - getAll(key) { - validateKey(key); - const resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - const state = resolver$$1.state; - let i = state.length; - const results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - } - createChild() { - const child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - } - invoke(fn, dynamicDependencies) { - try { - let handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new aureliaPal.AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); - } - } - _createInvocationHandler(fn) { - let dependencies; - if (fn.inject === undefined) { - dependencies = - aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - let ctor = fn; - while (typeof ctor === 'function') { - dependencies.push(...getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - const invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; - const handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - } - } + var Lazy_1, All_1, Optional_1, Parent_1, Factory_1, NewInstance_1; + const resolver = aureliaMetadata.protocol.create('aurelia:resolver', (target) => { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; + }); + exports.Strategy = void 0; + (function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; + })(exports.Strategy || (exports.Strategy = {})); + function isStrategy(actual, expected, state) { + return actual === expected; + } + exports.StrategyResolver = class StrategyResolver { + constructor(strategy, state) { + this.strategy = strategy; + this.state = state; + } + get(container, key) { + if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { + const singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + } + }; + exports.StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], exports.StrategyResolver); + exports.Lazy = Lazy_1 = class Lazy { + constructor(key) { + this._key = key; + } + get(container) { + return () => container.get(this._key); + } + static of(key) { + return new Lazy_1(key); + } + }; + exports.Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], exports.Lazy); + exports.All = All_1 = class All { + constructor(key) { + this._key = key; + } + get(container) { + return container.getAll(this._key); + } + static of(key) { + return new All_1(key); + } + }; + exports.All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], exports.All); + exports.Optional = Optional_1 = class Optional { + constructor(key, checkParent = true) { + this._key = key; + this._checkParent = checkParent; + } + get(container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + } + static of(key, checkParent = true) { + return new Optional_1(key, checkParent); + } + }; + exports.Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], exports.Optional); + exports.Parent = Parent_1 = class Parent { + constructor(key) { + this._key = key; + } + get(container) { + return container.parent ? container.parent.get(this._key) : null; + } + static of(key) { + return new Parent_1(key); + } + }; + exports.Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], exports.Parent); + exports.Factory = Factory_1 = class Factory { + constructor(key) { + this._key = key; + } + get(container) { + let fn = this._key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === exports.Strategy.function) { + fn = resolver.state; + } + return (...rest) => container.invoke(fn, rest); + } + static of(key) { + return new Factory_1(key); + } + }; + exports.Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], exports.Factory); + exports.NewInstance = NewInstance_1 = class NewInstance { + constructor(key, ...dynamicDependencies) { + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + get(container) { + const dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(dependency => dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency)) + : undefined; + let fn = this.key; + const resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + const instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + } + as(key) { + this.asKey = key; + return this; + } + static of(key, ...dynamicDependencies) { + return new NewInstance_1(key, ...dynamicDependencies); + } + }; + exports.NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], exports.NewInstance); + function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; + } + function lazy(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = exports.Lazy.of(keyValue); + }; + } + function all(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = exports.All.of(keyValue); + }; + } + function optional(checkParentOrTarget = true) { + const deco = (checkParent) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = exports.Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); + } + function parent(target, _key, index) { + const inject = getDecoratorDependencies(target); + inject[index] = exports.Parent.of(inject[index]); + } + function factory(keyValue) { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = exports.Factory.of(keyValue); + }; + } + function newInstance(asKeyOrTarget, ...dynamicDependencies) { + const deco = (asKey) => { + return (target, _key, index) => { + const inject = getDecoratorDependencies(target); + inject[index] = exports.NewInstance.of(inject[index], ...dynamicDependencies); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); + } - function invoker(value) { - return target => { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); - }; - } - function invokeAsFactory(potentialTarget) { - const deco = (target) => { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; - } - class FactoryInvoker { - invoke(container, fn, dependencies) { - let i = dependencies.length; - const args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - } - invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - let i = staticDependencies.length; - let args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - } - } - FactoryInvoker.instance = new FactoryInvoker(); + let currentContainer = null; + function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + } + const _emptyParameters = Object.freeze([]); + aureliaMetadata.metadata.registration = 'aurelia:registration'; + aureliaMetadata.metadata.invoker = 'aurelia:invoker'; + const resolverDecorates = resolver.decorates; + class InvocationHandler { + constructor(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + invoke(container, dynamicDependencies) { + const previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + } + } + function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + let lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); + } + const classInvoker = { + invoke(container, Type, deps) { + const instances = deps.map((dep) => container.get(dep)); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies + }; + function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; + } + class Container { + constructor(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + makeGlobal() { + Container.instance = this; + return this; + } + setHandlerCreatedCallback(onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + } + registerInstance(key, instance) { + return this.registerResolver(key, new exports.StrategyResolver(0, instance === undefined ? key : instance)); + } + registerSingleton(key, fn) { + return this.registerResolver(key, new exports.StrategyResolver(exports.Strategy.singleton, fn === undefined ? key : fn)); + } + registerTransient(key, fn) { + return this.registerResolver(key, new exports.StrategyResolver(2, fn === undefined ? key : fn)); + } + registerHandler(key, handler) { + return this.registerResolver(key, new exports.StrategyResolver(exports.Strategy.function, handler)); + } + registerAlias(originalKey, aliasKey) { + return this.registerResolver(aliasKey, new exports.StrategyResolver(5, originalKey)); + } + registerResolver(key, resolver) { + validateKey(key); + const allResolvers = this._resolvers; + const result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new exports.StrategyResolver(4, [result, resolver])); + } + return resolver; + } + autoRegister(key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + const registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new exports.StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new exports.StrategyResolver(0, fn)); + } + autoRegisterAll(fns) { + let i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + } + unregister(key) { + this._resolvers.delete(key); + } + hasResolver(key, checkParent = false) { + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + } + getResolver(key) { + return this._resolvers.get(key); + } + get(key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + const registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + } + _get(key) { + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + } + getAll(key) { + validateKey(key); + const resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + } + createChild() { + const child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + } + invoke(fn, dynamicDependencies) { + try { + let handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new aureliaPal.AggregateError(`Error invoking ${fn.name}. Check the inner error for details.`, e, true); + } + } + _createInvocationHandler(fn) { + let dependencies; + if (fn.inject === undefined) { + dependencies = + aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + let ctor = fn; + while (typeof ctor === 'function') { + dependencies.push(...getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + const invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; + const handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + } + } + function resolve(...keys) { + if (currentContainer == null) { + throw new Error(`There is not a currently active container to resolve "${String(keys)}". Are you trying to "new SomeClass(...)" that has a resolve(...) call?`); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); + } + function containerGetKey(key) { + return this.get(key); + } - function registration(value) { - return (target) => { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); - }; - } - function transient(key) { - return registration(new TransientRegistration(key)); - } - function singleton(keyOrRegisterInChild, registerInChild = false) { - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); - } - class TransientRegistration { - constructor(key) { - this._key = key; - } - registerResolver(container, key, fn) { - const existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - } - } - class SingletonRegistration { - constructor(keyOrRegisterInChild, registerInChild = false) { - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - registerResolver(container, key, fn) { - const targetContainer = this._registerInChild ? container : container.root; - const existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - } - } + function invoker(value) { + return target => { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); + }; + } + function invokeAsFactory(potentialTarget) { + const deco = (target) => { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; + } + class FactoryInvoker { + invoke(container, fn, dependencies) { + let i = dependencies.length; + const args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + } + invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + let i = staticDependencies.length; + let args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + } + } + FactoryInvoker.instance = new FactoryInvoker(); - exports._emptyParameters = _emptyParameters; - exports.InvocationHandler = InvocationHandler; - exports.Container = Container; - exports.autoinject = autoinject; - exports.inject = inject; - exports.invoker = invoker; - exports.invokeAsFactory = invokeAsFactory; - exports.FactoryInvoker = FactoryInvoker; - exports.registration = registration; - exports.transient = transient; - exports.singleton = singleton; - exports.TransientRegistration = TransientRegistration; - exports.SingletonRegistration = SingletonRegistration; - exports.resolver = resolver; - exports.getDecoratorDependencies = getDecoratorDependencies; - exports.lazy = lazy; - exports.all = all; - exports.optional = optional; - exports.parent = parent; - exports.factory = factory; - exports.newInstance = newInstance; + function registration(value) { + return (target) => { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); + }; + } + function transient(key) { + return registration(new TransientRegistration(key)); + } + function singleton(keyOrRegisterInChild, registerInChild = false) { + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); + } + class TransientRegistration { + constructor(key) { + this._key = key; + } + registerResolver(container, key, fn) { + const existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + } + } + class SingletonRegistration { + constructor(keyOrRegisterInChild, registerInChild = false) { + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + registerResolver(container, key, fn) { + const targetContainer = this._registerInChild ? container : container.root; + const existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + } + } - Object.defineProperty(exports, '__esModule', { value: true }); + exports.Container = Container; + exports.FactoryInvoker = FactoryInvoker; + exports.InvocationHandler = InvocationHandler; + exports.SingletonRegistration = SingletonRegistration; + exports.TransientRegistration = TransientRegistration; + exports._emptyParameters = _emptyParameters; + exports.all = all; + exports.autoinject = autoinject; + exports.factory = factory; + exports.getDecoratorDependencies = getDecoratorDependencies; + exports.inject = inject; + exports.invokeAsFactory = invokeAsFactory; + exports.invoker = invoker; + exports.lazy = lazy; + exports.newInstance = newInstance; + exports.optional = optional; + exports.parent = parent; + exports.registration = registration; + exports.resolve = resolve; + exports.resolver = resolver; + exports.singleton = singleton; + exports.transient = transient; -}))); +})); +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/umd-es2015/aurelia-dependency-injection.js.map b/dist/umd-es2015/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..eed05b5 --- /dev/null +++ b/dist/umd-es2015/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":["metadata","protocol","Strategy","StrategyResolver","Lazy","All","Optional","Parent","Factory","NewInstance","AggregateError"],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;AAsCA;IACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;IAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACnI,SAAS,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,C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,KAAK,SAAS;IACnC,cAAE,SAAS,CAAC,iBAAiB,EAC1B,IAAI,CAAC,IAAI,IAAI,GAAG,GACjB,EAAkD,CAAC;kBACnD,gBAAgB,CAAC;SACtB;IACF,CAAA;UAMY,qBAAqB,CAAA;QAYhC,WACE,CAAA,oBAA+E,EAC/E,eAAA,GAA2B,KAAK,EAAA;IAChC,QAAA,IAAI,OAAO,oBAAoB,KAAK,SAAS,EAAE;IAC7C,YAAA,IAAI,CAAC,gBAAgB,GAAG,oBAAoB,CAAC;aAC9C;iBAAM;IACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;aACzC;SACF;IASM,IAAA,gBAAgB,CACrB,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;IAEhD,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;IAC3E,QAAA,MAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;YACvE,OAAO,gBAAgB,KAAK,SAAS;IACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;kBACvD,gBAAgB,CAAC;SACtB;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/dist/umd/aurelia-dependency-injection.js b/dist/umd/aurelia-dependency-injection.js index 43e1149..673f6a7 100644 --- a/dist/umd/aurelia-dependency-injection.js +++ b/dist/umd/aurelia-dependency-injection.js @@ -1,687 +1,728 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('aurelia-metadata'), require('aurelia-pal')) : - typeof define === 'function' && define.amd ? define(['exports', 'aurelia-metadata', 'aurelia-pal'], factory) : - (factory((global.au = global.au || {}, global.au.validation = {}),global.aureliaMetadata,global.au)); -}(this, (function (exports,aureliaMetadata,aureliaPal) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('aurelia-metadata'), require('aurelia-pal')) : + typeof define === 'function' && define.amd ? define(['exports', 'aurelia-metadata', 'aurelia-pal'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.au = global.au || {}, global.au.validation = {}), global.au, global.au)); +})(this, (function (exports, aureliaMetadata, aureliaPal) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 + /****************************************************************************** + Copyright (c) Microsoft Corporation. - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise, SuppressedError, Symbol */ - function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - } - function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - } - - function isInjectable(potentialTarget) { - return !!potentialTarget; - } - function autoinject(potentialTarget) { - var deco = function (target) { - if (!target.hasOwnProperty('inject')) { - target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || - _emptyParameters).slice(); - if (target.inject && target.inject.length > 0) { - if (target.inject[target.inject.length - 1] === Object) { - target.inject.splice(-1, 1); - } - } - } - }; - if (isInjectable(potentialTarget)) { - return deco(potentialTarget); - } - return deco; - } - function inject() { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return function (target, _key, descriptor) { - if (typeof descriptor === 'number') { - autoinject(target); - if (rest.length === 1) { - target.inject[descriptor] = rest[0]; - } - return; - } - if (descriptor) { - var fn = descriptor.value; - fn.inject = rest; - } - else { - target.inject = rest; - } - }; - } + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + } + + function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + } + + typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; - var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { - if (!(typeof target.get === 'function')) { - return 'Resolvers must implement: get(container: Container, key: any): any'; - } - return true; - }); - (function (Strategy) { - Strategy[Strategy["instance"] = 0] = "instance"; - Strategy[Strategy["singleton"] = 1] = "singleton"; - Strategy[Strategy["transient"] = 2] = "transient"; - Strategy[Strategy["function"] = 3] = "function"; - Strategy[Strategy["array"] = 4] = "array"; - Strategy[Strategy["alias"] = 5] = "alias"; - })(exports.Strategy || (exports.Strategy = {})); - function isStrategy(actual, expected, state) { - return actual === expected; - } - var StrategyResolver = (function () { - function StrategyResolver(strategy, state) { - this.strategy = strategy; - this.state = state; - } - StrategyResolver.prototype.get = function (container, key) { - if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { - return this.state; - } - if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { - var singleton = container.invoke(this.state); - this.state = singleton; - this.strategy = 0; - return singleton; - } - if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { - return container.invoke(this.state); - } - if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { - return this.state(container, key, this); - } - if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { - return this.state[0].get(container, key); - } - if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { - return container.get(this.state); - } - throw new Error('Invalid strategy: ' + this.strategy); - }; - StrategyResolver = __decorate([ - resolver(), - __metadata("design:paramtypes", [Number, Object]) - ], StrategyResolver); - return StrategyResolver; - }()); - var Lazy = (function () { - function Lazy(key) { - this._key = key; - } - Lazy_1 = Lazy; - Lazy.prototype.get = function (container) { - var _this = this; - return function () { return container.get(_this._key); }; - }; - Lazy.of = function (key) { - return new Lazy_1(key); - }; - var Lazy_1; - Lazy = Lazy_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Lazy); - return Lazy; - }()); - var All = (function () { - function All(key) { - this._key = key; - } - All_1 = All; - All.prototype.get = function (container) { - return container.getAll(this._key); - }; - All.of = function (key) { - return new All_1(key); - }; - var All_1; - All = All_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], All); - return All; - }()); - var Optional = (function () { - function Optional(key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - this._key = key; - this._checkParent = checkParent; - } - Optional_1 = Optional; - Optional.prototype.get = function (container) { - if (container.hasResolver(this._key, this._checkParent)) { - return container.get(this._key); - } - return null; - }; - Optional.of = function (key, checkParent) { - if (checkParent === void 0) { checkParent = true; } - return new Optional_1(key, checkParent); - }; - var Optional_1; - Optional = Optional_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Boolean]) - ], Optional); - return Optional; - }()); - var Parent = (function () { - function Parent(key) { - this._key = key; - } - Parent_1 = Parent; - Parent.prototype.get = function (container) { - return container.parent ? container.parent.get(this._key) : null; - }; - Parent.of = function (key) { - return new Parent_1(key); - }; - var Parent_1; - Parent = Parent_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Parent); - return Parent; - }()); - var Factory = (function () { - function Factory(key) { - this._key = key; - } - Factory_1 = Factory; - Factory.prototype.get = function (container) { - var fn = this._key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === exports.Strategy.function) { - fn = resolver.state; - } - return function () { - var rest = []; - for (var _i = 0; _i < arguments.length; _i++) { - rest[_i] = arguments[_i]; - } - return container.invoke(fn, rest); - }; - }; - Factory.of = function (key) { - return new Factory_1(key); - }; - var Factory_1; - Factory = Factory_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object]) - ], Factory); - return Factory; - }()); - var NewInstance = (function () { - function NewInstance(key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - this.key = key; - this.asKey = key; - this.dynamicDependencies = dynamicDependencies; - } - NewInstance_1 = NewInstance; - NewInstance.prototype.get = function (container) { - var dynamicDependencies = this.dynamicDependencies.length > 0 - ? this.dynamicDependencies.map(function (dependency) { - return dependency['protocol:aurelia:resolver'] - ? dependency.get(container) - : container.get(dependency); - }) - : undefined; - var fn = this.key; - var resolver = container.getResolver(fn); - if (resolver && resolver.strategy === 3) { - fn = resolver.state; - } - var instance = container.invoke(fn, dynamicDependencies); - container.registerInstance(this.asKey, instance); - return instance; - }; - NewInstance.prototype.as = function (key) { - this.asKey = key; - return this; - }; - NewInstance.of = function (key) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))(); - }; - var NewInstance_1; - NewInstance = NewInstance_1 = __decorate([ - resolver(), - __metadata("design:paramtypes", [Object, Object]) - ], NewInstance); - return NewInstance; - }()); - function getDecoratorDependencies(target) { - autoinject(target); - return target.inject; - } - function lazy(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Lazy.of(keyValue); - }; - } - function all(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = All.of(keyValue); - }; - } - function optional(checkParentOrTarget) { - if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } - var deco = function (checkParent) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Optional.of(inject$$1[index], checkParent); - }; - }; - if (typeof checkParentOrTarget === 'boolean') { - return deco(checkParentOrTarget); - } - return deco(true); - } - function parent(target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Parent.of(inject$$1[index]); - } - function factory(keyValue) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = Factory.of(keyValue); - }; - } - function newInstance(asKeyOrTarget) { - var dynamicDependencies = []; - for (var _i = 1; _i < arguments.length; _i++) { - dynamicDependencies[_i - 1] = arguments[_i]; - } - var deco = function (asKey) { - return function (target, _key, index) { - var inject$$1 = getDecoratorDependencies(target); - inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies)); - if (!!asKey) { - inject$$1[index].as(asKey); - } - }; - }; - if (arguments.length >= 1) { - return deco(asKeyOrTarget); - } - return deco(); - } + function isInjectable(potentialTarget) { + return !!potentialTarget; + } + function autoinject(potentialTarget) { + var deco = function (target) { + if (!target.hasOwnProperty('inject')) { + target.inject = (aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, target) || + _emptyParameters).slice(); + if (target.inject && target.inject.length > 0) { + if (target.inject[target.inject.length - 1] === Object) { + target.inject.splice(-1, 1); + } + } + } + }; + if (isInjectable(potentialTarget)) { + return deco(potentialTarget); + } + return deco; + } + function inject() { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return function (target, _key, descriptor) { + if (typeof descriptor === 'number') { + autoinject(target); + if (rest.length === 1) { + target.inject[descriptor] = rest[0]; + } + return; + } + if (descriptor) { + var fn = descriptor.value; + fn.inject = rest; + } + else { + target.inject = rest; + } + }; + } - function validateKey(key) { - if (key === null || key === undefined) { - throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - } - var _emptyParameters = Object.freeze([]); - aureliaMetadata.metadata.registration = 'aurelia:registration'; - aureliaMetadata.metadata.invoker = 'aurelia:invoker'; - var resolverDecorates = resolver.decorates; - var InvocationHandler = (function () { - function InvocationHandler(fn, invoker, dependencies) { - this.fn = fn; - this.invoker = invoker; - this.dependencies = dependencies; - } - InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { - return dynamicDependencies !== undefined - ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) - : this.invoker.invoke(container, this.fn, this.dependencies); - }; - return InvocationHandler; - }()); - function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - var lookup; - while (i--) { - lookup = staticDependencies[i]; - if (lookup === null || lookup === undefined) { - throw new Error('Constructor Parameter with index ' + - i + - ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); - } - else { - args[i] = container.get(lookup); - } - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return Reflect.construct(fn, args); - } - var classInvoker = { - invoke: function (container, Type, deps) { - var instances = deps.map(function (dep) { return container.get(dep); }); - return Reflect.construct(Type, instances); - }, - invokeWithDynamicDependencies: invokeWithDynamicDependencies - }; - function getDependencies(f) { - if (!f.hasOwnProperty('inject')) { - return []; - } - if (typeof f.inject === 'function') { - return f.inject(); - } - return f.inject; - } - var Container = (function () { - function Container(configuration) { - if (configuration === undefined) { - configuration = {}; - } - this._configuration = configuration; - this._onHandlerCreated = configuration.onHandlerCreated; - this._handlers = - configuration.handlers || (configuration.handlers = new Map()); - this._resolvers = new Map(); - this.root = this; - this.parent = null; - } - Container.prototype.makeGlobal = function () { - Container.instance = this; - return this; - }; - Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { - this._onHandlerCreated = onHandlerCreated; - this._configuration.onHandlerCreated = onHandlerCreated; - }; - Container.prototype.registerInstance = function (key, instance) { - return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); - }; - Container.prototype.registerSingleton = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn)); - }; - Container.prototype.registerTransient = function (key, fn) { - return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); - }; - Container.prototype.registerHandler = function (key, handler) { - return this.registerResolver(key, new StrategyResolver(3, handler)); - }; - Container.prototype.registerAlias = function (originalKey, aliasKey) { - return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); - }; - Container.prototype.registerResolver = function (key, resolver$$1) { - validateKey(key); - var allResolvers = this._resolvers; - var result = allResolvers.get(key); - if (result === undefined) { - allResolvers.set(key, resolver$$1); - } - else if (result.strategy === 4) { - result.state.push(resolver$$1); - } - else { - allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1])); - } - return resolver$$1; - }; - Container.prototype.autoRegister = function (key, fn) { - fn = fn === undefined ? key : fn; - if (typeof fn === 'function') { - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); - if (registration === undefined) { - return this.registerResolver(key, new StrategyResolver(1, fn)); - } - return registration.registerResolver(this, key, fn); - } - return this.registerResolver(key, new StrategyResolver(0, fn)); - }; - Container.prototype.autoRegisterAll = function (fns) { - var i = fns.length; - while (i--) { - this.autoRegister(fns[i]); - } - }; - Container.prototype.unregister = function (key) { - this._resolvers.delete(key); - }; - Container.prototype.hasResolver = function (key, checkParent) { - if (checkParent === void 0) { checkParent = false; } - validateKey(key); - return (this._resolvers.has(key) || - (checkParent && - this.parent !== null && - this.parent.hasResolver(key, checkParent))); - }; - Container.prototype.getResolver = function (key) { - return this._resolvers.get(key); - }; - Container.prototype.get = function (key) { - validateKey(key); - if (key === Container) { - return this; - } - if (resolverDecorates(key)) { - return key.get(this, key); - } - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); - if (registration === undefined) { - return this.parent._get(key); - } - return registration.registerResolver(this, key, key).get(this, key); - } - return resolver$$1.get(this, key); - }; - Container.prototype._get = function (key) { - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return this.autoRegister(key).get(this, key); - } - return this.parent._get(key); - } - return resolver$$1.get(this, key); - }; - Container.prototype.getAll = function (key) { - validateKey(key); - var resolver$$1 = this._resolvers.get(key); - if (resolver$$1 === undefined) { - if (this.parent === null) { - return _emptyParameters; - } - return this.parent.getAll(key); - } - if (resolver$$1.strategy === 4) { - var state = resolver$$1.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].get(this, key); - } - return results; - } - return [resolver$$1.get(this, key)]; - }; - Container.prototype.createChild = function () { - var child = new Container(this._configuration); - child.root = this.root; - child.parent = this; - return child; - }; - Container.prototype.invoke = function (fn, dynamicDependencies) { - try { - var handler = this._handlers.get(fn); - if (handler === undefined) { - handler = this._createInvocationHandler(fn); - this._handlers.set(fn, handler); - } - return handler.invoke(this, dynamicDependencies); - } - catch (e) { - throw new aureliaPal.AggregateError("Error invoking " + fn.name + ". Check the inner error for details.", e, true); - } - }; - Container.prototype._createInvocationHandler = function (fn) { - var dependencies; - if (fn.inject === undefined) { - dependencies = - aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; - } - else { - dependencies = []; - var ctor = fn; - while (typeof ctor === 'function') { - dependencies.push.apply(dependencies, getDependencies(ctor)); - ctor = Object.getPrototypeOf(ctor); - } - } - var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; - var handler = new InvocationHandler(fn, invoker, dependencies); - return this._onHandlerCreated !== undefined - ? this._onHandlerCreated(handler) - : handler; - }; - return Container; - }()); + var resolver = aureliaMetadata.protocol.create('aurelia:resolver', function (target) { + if (!(typeof target.get === 'function')) { + return 'Resolvers must implement: get(container: Container, key: any): any'; + } + return true; + }); + exports.Strategy = void 0; + (function (Strategy) { + Strategy[Strategy["instance"] = 0] = "instance"; + Strategy[Strategy["singleton"] = 1] = "singleton"; + Strategy[Strategy["transient"] = 2] = "transient"; + Strategy[Strategy["function"] = 3] = "function"; + Strategy[Strategy["array"] = 4] = "array"; + Strategy[Strategy["alias"] = 5] = "alias"; + })(exports.Strategy || (exports.Strategy = {})); + function isStrategy(actual, expected, state) { + return actual === expected; + } + var StrategyResolver = (function () { + function StrategyResolver(strategy, state) { + this.strategy = strategy; + this.state = state; + } + StrategyResolver.prototype.get = function (container, key) { + if (isStrategy(this.strategy, exports.Strategy.instance, this.state)) { + return this.state; + } + if (isStrategy(this.strategy, exports.Strategy.singleton, this.state)) { + var singleton = container.invoke(this.state); + this.state = singleton; + this.strategy = 0; + return singleton; + } + if (isStrategy(this.strategy, exports.Strategy.transient, this.state)) { + return container.invoke(this.state); + } + if (isStrategy(this.strategy, exports.Strategy.function, this.state)) { + return this.state(container, key, this); + } + if (isStrategy(this.strategy, exports.Strategy.array, this.state)) { + return this.state[0].get(container, key); + } + if (isStrategy(this.strategy, exports.Strategy.alias, this.state)) { + return container.get(this.state); + } + throw new Error('Invalid strategy: ' + this.strategy); + }; + StrategyResolver = __decorate([ + resolver(), + __metadata("design:paramtypes", [Number, Object]) + ], StrategyResolver); + return StrategyResolver; + }()); + var Lazy = (function () { + function Lazy(key) { + this._key = key; + } + Lazy_1 = Lazy; + Lazy.prototype.get = function (container) { + var _this = this; + return function () { return container.get(_this._key); }; + }; + Lazy.of = function (key) { + return new Lazy_1(key); + }; + var Lazy_1; + Lazy = Lazy_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Lazy); + return Lazy; + }()); + var All = (function () { + function All(key) { + this._key = key; + } + All_1 = All; + All.prototype.get = function (container) { + return container.getAll(this._key); + }; + All.of = function (key) { + return new All_1(key); + }; + var All_1; + All = All_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], All); + return All; + }()); + var Optional = (function () { + function Optional(key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + this._key = key; + this._checkParent = checkParent; + } + Optional_1 = Optional; + Optional.prototype.get = function (container) { + if (container.hasResolver(this._key, this._checkParent)) { + return container.get(this._key); + } + return null; + }; + Optional.of = function (key, checkParent) { + if (checkParent === void 0) { checkParent = true; } + return new Optional_1(key, checkParent); + }; + var Optional_1; + Optional = Optional_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Boolean]) + ], Optional); + return Optional; + }()); + var Parent = (function () { + function Parent(key) { + this._key = key; + } + Parent_1 = Parent; + Parent.prototype.get = function (container) { + return container.parent ? container.parent.get(this._key) : null; + }; + Parent.of = function (key) { + return new Parent_1(key); + }; + var Parent_1; + Parent = Parent_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Parent); + return Parent; + }()); + var Factory = (function () { + function Factory(key) { + this._key = key; + } + Factory_1 = Factory; + Factory.prototype.get = function (container) { + var fn = this._key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === exports.Strategy.function) { + fn = resolver.state; + } + return function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i] = arguments[_i]; + } + return container.invoke(fn, rest); + }; + }; + Factory.of = function (key) { + return new Factory_1(key); + }; + var Factory_1; + Factory = Factory_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object]) + ], Factory); + return Factory; + }()); + var NewInstance = (function () { + function NewInstance(key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + this.key = key; + this.asKey = key; + this.dynamicDependencies = dynamicDependencies; + } + NewInstance_1 = NewInstance; + NewInstance.prototype.get = function (container) { + var dynamicDependencies = this.dynamicDependencies.length > 0 + ? this.dynamicDependencies.map(function (dependency) { + return dependency['protocol:aurelia:resolver'] + ? dependency.get(container) + : container.get(dependency); + }) + : undefined; + var fn = this.key; + var resolver = container.getResolver(fn); + if (resolver && resolver.strategy === 3) { + fn = resolver.state; + } + var instance = container.invoke(fn, dynamicDependencies); + container.registerInstance(this.asKey, instance); + return instance; + }; + NewInstance.prototype.as = function (key) { + this.asKey = key; + return this; + }; + NewInstance.of = function (key) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + return new (NewInstance_1.bind.apply(NewInstance_1, __spreadArray([void 0, key], dynamicDependencies, false)))(); + }; + var NewInstance_1; + NewInstance = NewInstance_1 = __decorate([ + resolver(), + __metadata("design:paramtypes", [Object, Object]) + ], NewInstance); + return NewInstance; + }()); + function getDecoratorDependencies(target) { + autoinject(target); + return target.inject; + } + function lazy(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Lazy.of(keyValue); + }; + } + function all(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = All.of(keyValue); + }; + } + function optional(checkParentOrTarget) { + if (checkParentOrTarget === void 0) { checkParentOrTarget = true; } + var deco = function (checkParent) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Optional.of(inject[index], checkParent); + }; + }; + if (typeof checkParentOrTarget === 'boolean') { + return deco(checkParentOrTarget); + } + return deco(true); + } + function parent(target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Parent.of(inject[index]); + } + function factory(keyValue) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = Factory.of(keyValue); + }; + } + function newInstance(asKeyOrTarget) { + var dynamicDependencies = []; + for (var _i = 1; _i < arguments.length; _i++) { + dynamicDependencies[_i - 1] = arguments[_i]; + } + var deco = function (asKey) { + return function (target, _key, index) { + var inject = getDecoratorDependencies(target); + inject[index] = NewInstance.of.apply(NewInstance, __spreadArray([inject[index]], dynamicDependencies, false)); + if (!!asKey) { + inject[index].as(asKey); + } + }; + }; + if (arguments.length >= 1) { + return deco(asKeyOrTarget); + } + return deco(); + } - function invoker(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); - }; - } - function invokeAsFactory(potentialTarget) { - var deco = function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); - }; - return potentialTarget ? deco(potentialTarget) : deco; - } - var FactoryInvoker = (function () { - function FactoryInvoker() { - } - FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { - var i = dependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(dependencies[i]); - } - return fn.apply(undefined, args); - }; - FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { - var i = staticDependencies.length; - var args = new Array(i); - while (i--) { - args[i] = container.get(staticDependencies[i]); - } - if (dynamicDependencies !== undefined) { - args = args.concat(dynamicDependencies); - } - return fn.apply(undefined, args); - }; - return FactoryInvoker; - }()); - FactoryInvoker.instance = new FactoryInvoker(); + var currentContainer = null; + function validateKey(key) { + if (key === null || key === undefined) { + throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + } + var _emptyParameters = Object.freeze([]); + aureliaMetadata.metadata.registration = 'aurelia:registration'; + aureliaMetadata.metadata.invoker = 'aurelia:invoker'; + var resolverDecorates = resolver.decorates; + var InvocationHandler = (function () { + function InvocationHandler(fn, invoker, dependencies) { + this.fn = fn; + this.invoker = invoker; + this.dependencies = dependencies; + } + InvocationHandler.prototype.invoke = function (container, dynamicDependencies) { + var previousContainer = currentContainer; + currentContainer = container; + try { + return dynamicDependencies !== undefined + ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) + : this.invoker.invoke(container, this.fn, this.dependencies); + } + finally { + currentContainer = previousContainer; + } + }; + return InvocationHandler; + }()); + function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + var lookup; + while (i--) { + lookup = staticDependencies[i]; + if (lookup === null || lookup === undefined) { + throw new Error('Constructor Parameter with index ' + + i + + ' cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?'); + } + else { + args[i] = container.get(lookup); + } + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return Reflect.construct(fn, args); + } + var classInvoker = { + invoke: function (container, Type, deps) { + var instances = deps.map(function (dep) { return container.get(dep); }); + return Reflect.construct(Type, instances); + }, + invokeWithDynamicDependencies: invokeWithDynamicDependencies + }; + function getDependencies(f) { + if (!f.hasOwnProperty('inject')) { + return []; + } + if (typeof f.inject === 'function') { + return f.inject(); + } + return f.inject; + } + var Container = (function () { + function Container(configuration) { + if (configuration === undefined) { + configuration = {}; + } + this._configuration = configuration; + this._onHandlerCreated = configuration.onHandlerCreated; + this._handlers = + configuration.handlers || (configuration.handlers = new Map()); + this._resolvers = new Map(); + this.root = this; + this.parent = null; + } + Container.prototype.makeGlobal = function () { + Container.instance = this; + return this; + }; + Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) { + this._onHandlerCreated = onHandlerCreated; + this._configuration.onHandlerCreated = onHandlerCreated; + }; + Container.prototype.registerInstance = function (key, instance) { + return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance)); + }; + Container.prototype.registerSingleton = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.singleton, fn === undefined ? key : fn)); + }; + Container.prototype.registerTransient = function (key, fn) { + return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn)); + }; + Container.prototype.registerHandler = function (key, handler) { + return this.registerResolver(key, new StrategyResolver(exports.Strategy.function, handler)); + }; + Container.prototype.registerAlias = function (originalKey, aliasKey) { + return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey)); + }; + Container.prototype.registerResolver = function (key, resolver) { + validateKey(key); + var allResolvers = this._resolvers; + var result = allResolvers.get(key); + if (result === undefined) { + allResolvers.set(key, resolver); + } + else if (result.strategy === 4) { + result.state.push(resolver); + } + else { + allResolvers.set(key, new StrategyResolver(4, [result, resolver])); + } + return resolver; + }; + Container.prototype.autoRegister = function (key, fn) { + fn = fn === undefined ? key : fn; + if (typeof fn === 'function') { + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, fn); + if (registration === undefined) { + return this.registerResolver(key, new StrategyResolver(1, fn)); + } + return registration.registerResolver(this, key, fn); + } + return this.registerResolver(key, new StrategyResolver(0, fn)); + }; + Container.prototype.autoRegisterAll = function (fns) { + var i = fns.length; + while (i--) { + this.autoRegister(fns[i]); + } + }; + Container.prototype.unregister = function (key) { + this._resolvers.delete(key); + }; + Container.prototype.hasResolver = function (key, checkParent) { + if (checkParent === void 0) { checkParent = false; } + validateKey(key); + return (this._resolvers.has(key) || + (checkParent && + this.parent !== null && + this.parent.hasResolver(key, checkParent))); + }; + Container.prototype.getResolver = function (key) { + return this._resolvers.get(key); + }; + Container.prototype.get = function (key) { + validateKey(key); + if (key === Container) { + return this; + } + if (resolverDecorates(key)) { + return key.get(this, key); + } + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + var registration = aureliaMetadata.metadata.get(aureliaMetadata.metadata.registration, key); + if (registration === undefined) { + return this.parent._get(key); + } + return registration.registerResolver(this, key, key).get(this, key); + } + return resolver.get(this, key); + }; + Container.prototype._get = function (key) { + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return this.autoRegister(key).get(this, key); + } + return this.parent._get(key); + } + return resolver.get(this, key); + }; + Container.prototype.getAll = function (key) { + validateKey(key); + var resolver = this._resolvers.get(key); + if (resolver === undefined) { + if (this.parent === null) { + return _emptyParameters; + } + return this.parent.getAll(key); + } + if (resolver.strategy === 4) { + var state = resolver.state; + var i = state.length; + var results = new Array(i); + while (i--) { + results[i] = state[i].get(this, key); + } + return results; + } + return [resolver.get(this, key)]; + }; + Container.prototype.createChild = function () { + var child = new Container(this._configuration); + child.root = this.root; + child.parent = this; + return child; + }; + Container.prototype.invoke = function (fn, dynamicDependencies) { + try { + var handler = this._handlers.get(fn); + if (handler === undefined) { + handler = this._createInvocationHandler(fn); + this._handlers.set(fn, handler); + } + return handler.invoke(this, dynamicDependencies); + } + catch (e) { + throw new aureliaPal.AggregateError("Error invoking ".concat(fn.name, ". Check the inner error for details."), e, true); + } + }; + Container.prototype._createInvocationHandler = function (fn) { + var dependencies; + if (fn.inject === undefined) { + dependencies = + aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters; + } + else { + dependencies = []; + var ctor = fn; + while (typeof ctor === 'function') { + dependencies.push.apply(dependencies, getDependencies(ctor)); + ctor = Object.getPrototypeOf(ctor); + } + } + var invoker = aureliaMetadata.metadata.getOwn(aureliaMetadata.metadata.invoker, fn) || classInvoker; + var handler = new InvocationHandler(fn, invoker, dependencies); + return this._onHandlerCreated !== undefined + ? this._onHandlerCreated(handler) + : handler; + }; + return Container; + }()); + function resolve() { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + if (currentContainer == null) { + throw new Error("There is not a currently active container to resolve \"".concat(String(keys), "\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?")); + } + return keys.length === 1 + ? currentContainer.get(keys[0]) + : keys.map(containerGetKey, currentContainer); + } + function containerGetKey(key) { + return this.get(key); + } - function registration(value) { - return function (target) { - aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); - }; - } - function transient(key) { - return registration(new TransientRegistration(key)); - } - function singleton(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); - } - var TransientRegistration = (function () { - function TransientRegistration(key) { - this._key = key; - } - TransientRegistration.prototype.registerResolver = function (container, key, fn) { - var existingResolver = container.getResolver(this._key || key); - return existingResolver === undefined - ? container.registerTransient((this._key || key), fn) - : existingResolver; - }; - return TransientRegistration; - }()); - var SingletonRegistration = (function () { - function SingletonRegistration(keyOrRegisterInChild, registerInChild) { - if (registerInChild === void 0) { registerInChild = false; } - if (typeof keyOrRegisterInChild === 'boolean') { - this._registerInChild = keyOrRegisterInChild; - } - else { - this._key = keyOrRegisterInChild; - this._registerInChild = registerInChild; - } - } - SingletonRegistration.prototype.registerResolver = function (container, key, fn) { - var targetContainer = this._registerInChild ? container : container.root; - var existingResolver = targetContainer.getResolver(this._key || key); - return existingResolver === undefined - ? targetContainer.registerSingleton(this._key || key, fn) - : existingResolver; - }; - return SingletonRegistration; - }()); + function invoker(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, value, target); + }; + } + function invokeAsFactory(potentialTarget) { + var deco = function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target); + }; + return potentialTarget ? deco(potentialTarget) : deco; + } + var FactoryInvoker = (function () { + function FactoryInvoker() { + } + FactoryInvoker.prototype.invoke = function (container, fn, dependencies) { + var i = dependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(dependencies[i]); + } + return (fn.apply(undefined, args)); + }; + FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) { + var i = staticDependencies.length; + var args = new Array(i); + while (i--) { + args[i] = container.get(staticDependencies[i]); + } + if (dynamicDependencies !== undefined) { + args = args.concat(dynamicDependencies); + } + return fn.apply(undefined, args); + }; + return FactoryInvoker; + }()); + FactoryInvoker.instance = new FactoryInvoker(); - exports._emptyParameters = _emptyParameters; - exports.InvocationHandler = InvocationHandler; - exports.Container = Container; - exports.autoinject = autoinject; - exports.inject = inject; - exports.invoker = invoker; - exports.invokeAsFactory = invokeAsFactory; - exports.FactoryInvoker = FactoryInvoker; - exports.registration = registration; - exports.transient = transient; - exports.singleton = singleton; - exports.TransientRegistration = TransientRegistration; - exports.SingletonRegistration = SingletonRegistration; - exports.resolver = resolver; - exports.StrategyResolver = StrategyResolver; - exports.Lazy = Lazy; - exports.All = All; - exports.Optional = Optional; - exports.Parent = Parent; - exports.Factory = Factory; - exports.NewInstance = NewInstance; - exports.getDecoratorDependencies = getDecoratorDependencies; - exports.lazy = lazy; - exports.all = all; - exports.optional = optional; - exports.parent = parent; - exports.factory = factory; - exports.newInstance = newInstance; + function registration(value) { + return function (target) { + aureliaMetadata.metadata.define(aureliaMetadata.metadata.registration, value, target); + }; + } + function transient(key) { + return registration(new TransientRegistration(key)); + } + function singleton(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild)); + } + var TransientRegistration = (function () { + function TransientRegistration(key) { + this._key = key; + } + TransientRegistration.prototype.registerResolver = function (container, key, fn) { + var existingResolver = container.getResolver(this._key || key); + return existingResolver === undefined + ? container.registerTransient((this._key || key), fn) + : existingResolver; + }; + return TransientRegistration; + }()); + var SingletonRegistration = (function () { + function SingletonRegistration(keyOrRegisterInChild, registerInChild) { + if (registerInChild === void 0) { registerInChild = false; } + if (typeof keyOrRegisterInChild === 'boolean') { + this._registerInChild = keyOrRegisterInChild; + } + else { + this._key = keyOrRegisterInChild; + this._registerInChild = registerInChild; + } + } + SingletonRegistration.prototype.registerResolver = function (container, key, fn) { + var targetContainer = this._registerInChild ? container : container.root; + var existingResolver = targetContainer.getResolver(this._key || key); + return existingResolver === undefined + ? targetContainer.registerSingleton(this._key || key, fn) + : existingResolver; + }; + return SingletonRegistration; + }()); - Object.defineProperty(exports, '__esModule', { value: true }); + exports.All = All; + exports.Container = Container; + exports.Factory = Factory; + exports.FactoryInvoker = FactoryInvoker; + exports.InvocationHandler = InvocationHandler; + exports.Lazy = Lazy; + exports.NewInstance = NewInstance; + exports.Optional = Optional; + exports.Parent = Parent; + exports.SingletonRegistration = SingletonRegistration; + exports.StrategyResolver = StrategyResolver; + exports.TransientRegistration = TransientRegistration; + exports._emptyParameters = _emptyParameters; + exports.all = all; + exports.autoinject = autoinject; + exports.factory = factory; + exports.getDecoratorDependencies = getDecoratorDependencies; + exports.inject = inject; + exports.invokeAsFactory = invokeAsFactory; + exports.invoker = invoker; + exports.lazy = lazy; + exports.newInstance = newInstance; + exports.optional = optional; + exports.parent = parent; + exports.registration = registration; + exports.resolve = resolve; + exports.resolver = resolver; + exports.singleton = singleton; + exports.transient = transient; -}))); +})); +//# sourceMappingURL=aurelia-dependency-injection.js.map diff --git a/dist/umd/aurelia-dependency-injection.js.map b/dist/umd/aurelia-dependency-injection.js.map new file mode 100644 index 0000000..eb4daec --- /dev/null +++ b/dist/umd/aurelia-dependency-injection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-dependency-injection.js","sources":["../../node_modules/tslib/tslib.es6.js","../../../src/injection.ts","../../../src/resolvers.ts","../../../src/container.ts","../../../src/invokers.ts","../../../src/registrations.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { metadata } from 'aurelia-metadata';\r\nimport { _emptyParameters } from './container';\r\nimport { Args, Impl, DependencyCtor } from './types';\r\n\r\n// tslint:disable-next-line:ban-types\r\nexport type Injectable = Function & { inject?: any[] | (() => any[]) };\r\n\r\nfunction isInjectable(potentialTarget: any): potentialTarget is Injectable {\r\n return !!potentialTarget;\r\n}\r\n\r\n/**\r\n * Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\n * the decorated class.\r\n */\r\nexport function autoinject(\r\n potentialTarget?: TPotential\r\n): TPotential extends Injectable ? void : (target: Injectable) => void {\r\n const deco = (target: Injectable): void => {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (\r\n (metadata.getOwn(metadata.paramTypes, target) as any[]) ||\r\n _emptyParameters\r\n ).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n // TypeScript 3.0 metadata for \"...rest\" gives type \"Object\"\r\n // if last parameter is \"Object\", assume it's a ...rest and remove that\r\n // metadata.\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget) as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n }\r\n return deco as TPotential extends Injectable ? void : (target: Injectable) => void;\r\n}\r\n/**\r\n * Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function.\r\n */\r\nexport function inject<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(...rest: TArgs[number][]): any {\r\n return (\r\n target: DependencyCtor & { inject: any },\r\n _key: any,\r\n descriptor: any) => {\r\n // handle when used as a constructor parameter decorator\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n // if it's true then we injecting rest into function and not Class constructor\r\n if (descriptor) {\r\n const fn = descriptor.value;\r\n fn.inject = rest;\r\n } else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\r\n","import { protocol } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { autoinject } from './injection';\r\nimport type {\r\n PrimitiveOrDependencyCtor,\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n DependencyCtor,\r\n DependencyFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Indicates that the decorated class/object is a custom resolver.\r\n */\r\nexport const resolver: {\r\n decorates?: (key: any) => key is { get(container: Container, key: any): any };\r\n} & (() => any) = ((protocol as unknown) as { create(...args: any[]): any }).create(\r\n 'aurelia:resolver',\r\n (target): string | boolean => {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n\r\n return true;\r\n }\r\n);\r\n\r\n/**\r\n * Used to allow functions/classes to specify custom dependency resolution logic.\r\n */\r\nexport interface Resolver {\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n get(container: Container, key: any): any;\r\n}\r\n\r\nexport enum Strategy {\r\n instance = 0,\r\n singleton = 1,\r\n transient = 2,\r\n function = 3,\r\n array = 4,\r\n alias = 5\r\n}\r\nexport type IStrategy = 1 | 2 | 3 | 4 | 5;\r\n\r\nexport type StrategyFunctor<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > = (\r\n container?: Container,\r\n ctor?: PrimitiveOrDependencyCtorOrFunctor,\r\n strategyResolver?: any\r\n ) => TImpl;\r\n\r\nexport interface StrategyState<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > {\r\n [Strategy.instance]: TImpl;\r\n [Strategy.singleton]: DependencyCtorOrFunctor;\r\n [Strategy.transient]: DependencyCtorOrFunctor;\r\n [Strategy.function]: StrategyFunctor;\r\n /**\r\n * For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\n * But it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]\r\n */\r\n [Strategy.array]: ({\r\n get: (\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor\r\n ) => TImpl\r\n } | TImpl)[];\r\n [Strategy.alias]: any;\r\n}\r\n\r\nfunction isStrategy<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TKey extends keyof StrategyState\r\n>(\r\n actual: Strategy,\r\n expected: TKey,\r\n state):\r\n state is StrategyState[TKey] {\r\n return actual === expected;\r\n}\r\n/**\r\n * Used to resolve instances, singletons, transients, aliases\r\n */\r\n@resolver()\r\nexport class StrategyResolver<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args,\r\n TStrategyKey extends keyof StrategyState> {\r\n\r\n public strategy: keyof StrategyState;\r\n public state: StrategyState[keyof StrategyState];\r\n\r\n /**\r\n * Creates an instance of the StrategyResolver class.\r\n * @param strategy The type of resolution strategy.\r\n * @param state The state associated with the resolution strategy.\r\n */\r\n constructor(strategy: TStrategyKey, state: StrategyState[TStrategyKey]) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n\r\n /**\r\n * Called by the container to allow custom resolution of dependencies for a\r\n * function/class.\r\n * @param container The container to resolve from.\r\n * @param key The key that the resolver was registered as.\r\n * @return Returns the resolved object.\r\n */\r\n public get(container: Container, key: PrimitiveOrDependencyCtor) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n const singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return (this.state[0] as { get: StrategyFunctor }).get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state) as TImpl;\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify lazy resolution logic.\r\n */\r\n@resolver()\r\nexport class Lazy = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'lazy';\r\n\r\n /**\r\n * Creates an instance of the Lazy class.\r\n * @param key The key to lazily resolve.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to lazily resolve the dependency into a lazy locator\r\n * function.\r\n * @param container The container to resolve from.\r\n * @return Returns a function which can be invoked at a later time to obtain\r\n * the actual dependency.\r\n */\r\n public get(container: Container): () => ImplOrAny {\r\n return () => container.get(this._key);\r\n }\r\n\r\n /**\r\n * Creates a Lazy Resolver for the supplied key.\r\n * @param key The key to lazily resolve.\r\n * @return Returns an instance of Lazy for the key.\r\n */\r\n public static of<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ) {\r\n return new Lazy(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify resolution of all matches to a key.\r\n */\r\n@resolver()\r\nexport class All = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'all';\r\n\r\n /**\r\n * Creates an instance of the All class.\r\n * @param key The key to lazily resolve all matches for.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to resolve all matching dependencies as an array of\r\n * instances.\r\n * @param container The container to resolve from.\r\n * @return Returns an array of all matching instances.\r\n */\r\n public get(container: Container): TImpl[] {\r\n return container.getAll(this._key);\r\n }\r\n\r\n /**\r\n * Creates an All Resolver for the supplied key.\r\n * @param key The key to resolve all instances for.\r\n * @return Returns an instance of All for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): All {\r\n return new All(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to specify an optional dependency, which will\r\n * be resolved only if already registred with the container.\r\n */\r\n@resolver()\r\nexport class Optional = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /** @internal */\r\n public _checkParent: boolean;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'optional';\r\n\r\n /**\r\n * Creates an instance of the Optional class.\r\n * @param key The key to optionally resolve for.\r\n * @param checkParent Indicates whether or not the parent container hierarchy\r\n * should be checked.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor, checkParent: boolean = true) {\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n\r\n /**\r\n * Called by the container to provide optional resolution of the key.\r\n * @param container The container to resolve from.\r\n * @return Returns the instance if found; otherwise null.\r\n */\r\n public get(container: Container): TImpl | null {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an Optional Resolver for the supplied key.\r\n * @param key The key to optionally resolve for.\r\n * @param [checkParent=true] Indicates whether or not the parent container\r\n * hierarchy should be checked.\r\n * @return Returns an instance of Optional for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n checkParent: boolean = true): Optional {\r\n return new Optional(key, checkParent);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject the dependency from the parent container instead of the current\r\n * one.\r\n */\r\n@resolver()\r\nexport class Parent = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'parent';\r\n\r\n /**\r\n * Creates an instance of the Parent class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to load the dependency from the parent container\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container): TImpl | null {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n }\r\n\r\n /**\r\n * Creates a Parent Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Parent for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor\r\n ): Parent {\r\n return new Parent(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow injecting dependencies but also passing data to the constructor.\r\n */\r\n@resolver()\r\nexport class Factory = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public _key: PrimitiveOrDependencyCtorOrFunctor;\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'factory';\r\n\r\n /**\r\n * Creates an instance of the Factory class.\r\n * @param key The key to resolve from the parent container.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to pass the dependencies to the constructor.\r\n * @param container The container to invoke the constructor with dependencies\r\n * and other parameters.\r\n * @return Returns a function that can be invoked to resolve dependencies\r\n * later, and the rest of the parameters.\r\n */\r\n public get(container: Container): DependencyFunctor {\r\n let fn = this._key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n\r\n return (...rest) => container.invoke(fn as DependencyCtorOrFunctor, rest);\r\n }\r\n\r\n /**\r\n * Creates a Factory Resolver for the supplied key.\r\n * @param key The key to resolve.\r\n * @return Returns an instance of Factory for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: DependencyCtor\r\n ): Factory {\r\n return new Factory(key);\r\n }\r\n}\r\n\r\n/**\r\n * Used to inject a new instance of a dependency, without regard for existing\r\n * instances in the container. Instances can optionally be registered in the\r\n * container\r\n * under a different key by supplying a key using the `as` method.\r\n */\r\n@resolver()\r\nexport class NewInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args> {\r\n /** @internal */\r\n public key: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public asKey: PrimitiveOrDependencyCtorOrFunctor;\r\n /** @internal */\r\n public dynamicDependencies: TArgs[number][];\r\n\r\n /**\r\n * A non existent property to help TS distinguish resolvers\r\n *\r\n * This is semi-private, and should not be used by application\r\n */\r\n __resolver_type__!: 'newInstance';\r\n\r\n /**\r\n * Creates an instance of the NewInstance class.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n */\r\n constructor(key: PrimitiveOrDependencyCtorOrFunctor, ...dynamicDependencies: TArgs[number][]) {\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n\r\n /**\r\n * Called by the container to instantiate the dependency and potentially\r\n * register\r\n * as another key if the `as` method was used.\r\n * @param container The container to resolve the parent from.\r\n * @return Returns the matching instance from the parent container\r\n */\r\n public get(container: Container) {\r\n const dynamicDependencies =\r\n this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(dependency =>\r\n dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency)\r\n )\r\n : undefined;\r\n\r\n let fn = this.key;\r\n const resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n\r\n const instance = container.invoke(fn as DependencyCtorOrFunctor, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n }\r\n\r\n /**\r\n * Instructs the NewInstance resolver to register the resolved instance using\r\n * the supplied key.\r\n * @param key The key to register the instance with.\r\n * @return Returns the NewInstance resolver.\r\n */\r\n public as(key: PrimitiveOrDependencyCtorOrFunctor) {\r\n this.asKey = key;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates an NewInstance Resolver for the supplied key.\r\n * @param key The key to resolve/instantiate.\r\n * @param dynamicDependencies An optional list of dynamic dependencies.\r\n * @return Returns an instance of NewInstance for the key.\r\n */\r\n public static of = Impl,\r\n TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtorOrFunctor,\r\n ...dynamicDependencies: TArgs[number][]): NewInstance {\r\n return new NewInstance(key, ...dynamicDependencies);\r\n }\r\n}\r\n\r\n/**\r\n * Used by parameter decorators to call autoinject for the target and retrieve\r\n * the target's inject property.\r\n * @param target The target class.\r\n * @return Returns the target's own inject property.\r\n */\r\nexport function getDecoratorDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] }\r\n ) {\r\n autoinject(target);\r\n\r\n return target.inject;\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should be lazy loaded\r\n */\r\nexport function lazy<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: { new (...args: TArgs): TBase | TImpl },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Lazy.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency should load all instances of the given\r\n * key.\r\n */\r\nexport function all<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = All.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as optional\r\n */\r\nexport function optional<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n checkParentOrTarget: boolean = true) {\r\n const deco = (checkParent: boolean) => {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Optional.of(inject[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to look at the parent container for\r\n * resolution\r\n */\r\nexport function parent<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number) {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Parent.of(inject[index]);\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency to create a factory method, that can\r\n * accept optional arguments\r\n */\r\nexport function factory<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n keyValue: any\r\n ) {\r\n return (\r\n target: DependencyCtor & { inject?: TArgs[number][] },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = Factory.of(keyValue);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\n * under a different key and/or use dynamic dependencies\r\n */\r\nexport function newInstance<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n asKeyOrTarget?: PrimitiveOrDependencyCtor & { inject?: TArgs[number][] },\r\n ...dynamicDependencies: TArgs[number][]\r\n) {\r\n const deco = (asKey?: typeof asKeyOrTarget) => {\r\n return (\r\n target: { new (...args: any[]): any },\r\n _key,\r\n index: number\r\n ) => {\r\n const inject = getDecoratorDependencies(target)!;\r\n inject[index] = NewInstance.of(inject[index], ...dynamicDependencies);\r\n if (!!asKey) {\r\n inject[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { AggregateError } from 'aurelia-pal';\r\nimport { resolver, StrategyResolver, Resolver, Strategy, StrategyState, Factory, NewInstance, Lazy, Optional, All, Parent } from './resolvers';\r\nimport { Invoker } from './invokers';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n DependencyCtor,\r\n PrimitiveOrDependencyCtor,\r\n PrimitiveOrDependencyCtorOrFunctor,\r\n ImplOrAny,\r\n Impl,\r\n Args,\r\n Primitive\r\n} from './types';\r\n\r\nlet currentContainer: Container | null = null;\r\n\r\nfunction validateKey(key: any) {\r\n if (key === null || key === undefined) {\r\n throw new Error(\r\n 'key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const _emptyParameters = Object.freeze([]) as [];\r\n\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\n\r\nconst resolverDecorates = resolver.decorates!;\r\n\r\n/**\r\n * Stores the information needed to invoke a function.\r\n */\r\nexport class InvocationHandler<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args\r\n > {\r\n /**\r\n * The function to be invoked by this handler.\r\n */\r\n public fn: DependencyCtorOrFunctor;\r\n\r\n /**\r\n * The invoker implementation that will be used to actually invoke the function.\r\n */\r\n public invoker: Invoker;\r\n\r\n /**\r\n * The statically known dependencies of this function invocation.\r\n */\r\n public dependencies: TArgs;\r\n\r\n /**\r\n * Instantiates an InvocationDescription.\r\n * @param fn The Function described by this description object.\r\n * @param invoker The strategy for invoking the function.\r\n * @param dependencies The static dependencies of the function call.\r\n */\r\n constructor(\r\n fn: DependencyCtorOrFunctor,\r\n invoker: Invoker,\r\n dependencies: TArgs\r\n ) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n\r\n /**\r\n * Invokes the function.\r\n * @param container The calling container.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(container: Container, dynamicDependencies?: TArgs[]): TImpl {\r\n const previousContainer = currentContainer;\r\n currentContainer = container;\r\n try {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(\r\n container,\r\n this.fn,\r\n this.dependencies,\r\n dynamicDependencies\r\n )\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n } finally {\r\n currentContainer = previousContainer;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used to configure a Container instance.\r\n */\r\nexport interface ContainerConfiguration {\r\n /**\r\n * An optional callback which will be called when any function needs an\r\n * InvocationHandler created (called once per Function).\r\n */\r\n onHandlerCreated?: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n handlers?: Map;\r\n}\r\n\r\nfunction invokeWithDynamicDependencies<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n>(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n) {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n let lookup;\r\n\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error(\r\n 'Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?'\r\n );\r\n } else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return Reflect.construct(fn, args);\r\n}\r\n\r\nconst classInvoker: Invoker = {\r\n invoke(container, Type: DependencyCtor, deps) {\r\n const instances = deps.map((dep) => container.get(dep));\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies\r\n};\r\n\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n\r\n return f.inject;\r\n}\r\n\r\n/**\r\n * A lightweight, extensible dependency injection container.\r\n */\r\nexport class Container {\r\n /**\r\n * The global root Container instance. Available if makeGlobal() has been\r\n * called. Aurelia Framework calls makeGlobal().\r\n */\r\n public static instance: Container;\r\n\r\n /**\r\n * The parent container in the DI hierarchy.\r\n */\r\n public parent: Container | null;\r\n\r\n /**\r\n * The root container in the DI hierarchy.\r\n */\r\n public root: Container;\r\n\r\n /** @internal */\r\n public _configuration: ContainerConfiguration;\r\n\r\n /** @internal */\r\n public _onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler;\r\n\r\n /** @internal */\r\n public _handlers: Map;\r\n\r\n /** @internal */\r\n public _resolvers: Map;\r\n\r\n /**\r\n * Creates an instance of Container.\r\n * @param configuration Provides some configuration for the new Container instance.\r\n */\r\n constructor(configuration?: ContainerConfiguration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated!;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n\r\n /**\r\n * Makes this container instance globally reachable through Container.instance.\r\n */\r\n public makeGlobal(): Container {\r\n Container.instance = this;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets an invocation handler creation callback that will be called when new\r\n * InvocationsHandlers are created (called once per Function).\r\n * @param onHandlerCreated The callback to be called when an\r\n * InvocationsHandler is created.\r\n */\r\n public setHandlerCreatedCallback<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args>(\r\n onHandlerCreated: (\r\n handler: InvocationHandler\r\n ) => InvocationHandler\r\n ) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n }\r\n\r\n /**\r\n * Registers an existing object instance with the container.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param instance The instance that will be resolved when the key is matched.\r\n * This defaults to the key value when instance is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerInstance = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n instance?: TImpl): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(0, instance === undefined ? key : instance)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container always\r\n * returns the same instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerSingleton = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.singleton, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) such that the container returns a\r\n * new instance for each request.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n * @return The resolver that was registered.\r\n */\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public registerTransient = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(2, fn === undefined ? key as DependencyCtor : fn)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param handler The resolution function to use when the dependency is\r\n * needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerHandler = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n handler: (container?: Container, key?: PrimitiveOrDependencyCtor, resolver?: Resolver) => any\r\n ): Resolver {\r\n return this.registerResolver(\r\n key,\r\n new StrategyResolver(Strategy.function, handler)\r\n );\r\n }\r\n\r\n /**\r\n * Registers an additional key that serves as an alias to the original DI key.\r\n * @param originalKey The key that originally identified the dependency; usually a constructor function.\r\n * @param aliasKey An alternate key which can also be used to resolve the same dependency as the original.\r\n * @return The resolver that was registered.\r\n */\r\n public registerAlias = Impl, TArgs extends Args = Args>(\r\n originalKey: PrimitiveOrDependencyCtor,\r\n aliasKey: PrimitiveOrDependencyCtor): Resolver {\r\n return this.registerResolver(\r\n aliasKey,\r\n new StrategyResolver(5, originalKey)\r\n );\r\n }\r\n\r\n /**\r\n * Registers a custom resolution function such that the container calls this\r\n * function for each request to obtain the instance.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param resolver The resolver to use when the dependency is needed.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor,\r\n resolver: Resolver\r\n ): Resolver {\r\n validateKey(key);\r\n\r\n const allResolvers = this._resolvers;\r\n const result = allResolvers.get(key);\r\n\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver);\r\n } else if (result.strategy === 4) {\r\n result.state.push(resolver);\r\n } else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver]));\r\n }\r\n\r\n return resolver;\r\n }\r\n\r\n /**\r\n * Registers a type (constructor function) by inspecting its registration\r\n * annotations. If none are found, then the default singleton registration is\r\n * used.\r\n * @param key The key that identifies the dependency at resolution time;\r\n * usually a constructor function.\r\n * @param fn The constructor function to use when the dependency needs to be\r\n * instantiated. This defaults to the key value when fn is not supplied.\r\n */\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: Primitive, fn: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: DependencyCtor, fn?: DependencyCtorOrFunctor): Resolver;\r\n public autoRegister = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, fn?: DependencyCtorOrFunctor): Resolver {\r\n fn = fn === undefined ? key as DependencyCtor : fn;\r\n\r\n if (typeof fn === 'function') {\r\n const registration = metadata.get(metadata.registration, fn);\r\n\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n }\r\n\r\n /**\r\n * Registers an array of types (constructor functions) by inspecting their\r\n * registration annotations. If none are found, then the default singleton\r\n * registration is used.\r\n * @param fns The constructor function to use when the dependency needs to be instantiated.\r\n */\r\n public autoRegisterAll(fns: DependencyCtor[]): void {\r\n let i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Unregisters based on key.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n */\r\n public unregister(key: any): void {\r\n this._resolvers.delete(key);\r\n }\r\n\r\n /**\r\n * Inspects the container to determine if a particular key has been registred.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @param checkParent Indicates whether or not to check the parent container hierarchy.\r\n * @return Returns true if the key has been registred; false otherwise.\r\n */\r\n public hasResolver = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor, checkParent: boolean = false): boolean {\r\n validateKey(key);\r\n\r\n return (\r\n this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent))\r\n );\r\n }\r\n\r\n /**\r\n * Gets the resolver for the particular key, if it has been registered.\r\n * @param key The key that identifies the dependency at resolution time; usually a constructor function.\r\n * @return Returns the resolver, if registred, otherwise undefined.\r\n */\r\n public getResolver<\r\n TStrategyKey extends keyof StrategyState,\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n >(\r\n key: PrimitiveOrDependencyCtorOrFunctor\r\n ): StrategyResolver {\r\n return this._resolvers.get(key);\r\n }\r\n\r\n /**\r\n * Resolves a single instance based on the provided key.\r\n * @param key The key that identifies the object to resolve.\r\n * @return Returns the resolved instance.\r\n */\r\n public get | Lazy | Factory | Optional | Parent | All>(\r\n key: TResolver): ResolvedValue;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: typeof Container): Container;\r\n public get = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor | typeof Container): ImplOrAny | Container {\r\n validateKey(key);\r\n\r\n if (key === Container) {\r\n return this;\r\n }\r\n\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key as DependencyCtor).get(this, key);\r\n }\r\n\r\n const registration = metadata.get(metadata.registration, key);\r\n\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n\r\n return registration.registerResolver(\r\n this, key, key as DependencyCtorOrFunctor).get(this, key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n public _get(key) {\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n\r\n return this.parent._get(key);\r\n }\r\n\r\n return resolver.get(this, key);\r\n }\r\n\r\n /**\r\n * Resolves all instance registered under the provided key.\r\n * @param key The key that identifies the objects to resolve.\r\n * @return Returns an array of the resolved instances.\r\n */\r\n public getAll = Impl, TArgs extends Args = Args>(\r\n key: PrimitiveOrDependencyCtor): ImplOrAny[] {\r\n validateKey(key);\r\n\r\n const resolver = this._resolvers.get(key);\r\n\r\n if (resolver === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n\r\n return this.parent.getAll(key);\r\n }\r\n\r\n if (resolver.strategy === 4) {\r\n const state = resolver.state;\r\n let i = state.length;\r\n const results = new Array(i);\r\n\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n\r\n return results;\r\n }\r\n\r\n return [resolver.get(this, key)];\r\n }\r\n\r\n /**\r\n * Creates a new dependency injection container whose parent is the current container.\r\n * @return Returns a new container instance parented to this.\r\n */\r\n public createChild(): Container {\r\n const child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n }\r\n\r\n /**\r\n * Invokes a function, recursively resolving its dependencies.\r\n * @param fn The function to invoke with the auto-resolved dependencies.\r\n * @param dynamicDependencies Additional function dependencies to use during invocation.\r\n * @return Returns the instance resulting from calling the function.\r\n */\r\n public invoke = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor,\r\n dynamicDependencies?: TArgs[number][]\r\n ): ImplOrAny {\r\n try {\r\n let handler = this._handlers.get(fn);\r\n\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n\r\n return handler.invoke(this, dynamicDependencies);\r\n } catch (e) {\r\n // @ts-expect-error AggregateError returns an Error in its type hence it fails (new ...) but it's fine\r\n throw new AggregateError(\r\n `Error invoking ${fn.name}. Check the inner error for details.`,\r\n e as Error | undefined,\r\n true\r\n );\r\n }\r\n }\r\n\r\n public _createInvocationHandler\r\n = Impl, TArgs extends Args = Args>(\r\n fn: DependencyCtorOrFunctor & { inject?: any; }\r\n ): InvocationHandler {\r\n let dependencies;\r\n\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n } else {\r\n dependencies = [];\r\n let ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push(...getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n\r\n const invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n\r\n const handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n }\r\n}\r\n\r\nexport type ResolvedValue =\r\n T extends { new (...args: any[]): infer R }\r\n ? R\r\n : T extends Factory\r\n ? (...args: unknown[]) => R\r\n : T extends Lazy\r\n ? () => R\r\n : T extends NewInstance\r\n ? R\r\n : T extends Optional\r\n ? R | null\r\n : T extends All\r\n ? R[]\r\n : T extends Parent\r\n ? R | null\r\n : T extends [infer T1, ...infer T2]\r\n ? [ResolvedValue, ...ResolvedValue]\r\n : T;\r\n\r\n/**\r\n * Resolve a key, or list of keys based on the current container.\r\n * \r\n * @example\r\n * ```ts\r\n * import { resolve } from 'aurelia-framework';\r\n * // or\r\n * // import { Container, resolve } from 'aurelia-dependency-injection';\r\n * \r\n * class MyCustomElement {\r\n * someService = resolve(MyService);\r\n * }\r\n * ```\r\n */\r\nexport function resolve(key: K): ResolvedValue;\r\nexport function resolve(...keys: K): ResolvedValue\r\nexport function resolve(...keys: K) {\r\n if (currentContainer == null) {\r\n throw new Error(`There is not a currently active container to resolve \"${String(keys)}\". Are you trying to \"new SomeClass(...)\" that has a resolve(...) call?`);\r\n }\r\n \r\n return keys.length === 1\r\n ? currentContainer.get(keys[0])\r\n : keys.map(containerGetKey, currentContainer);\r\n}\r\n\r\nfunction containerGetKey(this: Container, key: any) {\r\n return this.get(key);\r\n}\r\n","import './internal';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport { Container } from './container';\r\nimport { DependencyCtorOrFunctor, ImplOrAny, Impl, Args, DependencyCtor, DependencyFunctor } from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom Invoker for the decorated item.\r\n */\r\nexport function invoker, TArgs extends Args>(\r\n value: Invoker\r\n): (target: DependencyCtor) => void {\r\n return target => {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies that the decorated item should be called as a factory\r\n * function, rather than a constructor.\r\n */\r\nexport function invokeAsFactory, TArgs extends Args>(\r\n potentialTarget?: DependencyCtor\r\n): void | ((target: DependencyCtor) => void) {\r\n const deco = (target: DependencyCtor) => {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\n\r\n/**\r\n * A strategy for invoking a function, resulting in an object instance.\r\n */\r\nexport interface Invoker, TArgs extends Args> {\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during\r\n * invocation.\r\n * @return The result of the function invocation.\r\n */\r\n invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny;\r\n}\r\n\r\n/**\r\n * An Invoker that is used to invoke a factory method.\r\n */\r\nexport class FactoryInvoker<\r\n TBase,\r\n TImpl extends Impl = Impl,\r\n TArgs extends Args = Args\r\n > implements Invoker {\r\n /**\r\n * The singleton instance of the FactoryInvoker.\r\n */\r\n public static instance: FactoryInvoker;\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param dependencies The dependencies of the function call.\r\n * @return The result of the function invocation.\r\n */\r\n public invoke(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n dependencies: TArgs\r\n ): ImplOrAny {\r\n let i = dependencies.length;\r\n const args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n\r\n return ((fn as DependencyFunctor).apply(undefined, args as TArgs)) as ImplOrAny;\r\n }\r\n\r\n /**\r\n * Invokes the function with the provided dependencies.\r\n * @param container The calling container.\r\n * @param fn The constructor or factory function.\r\n * @param staticDependencies The static dependencies of the function.\r\n * @param dynamicDependencies Additional dependencies to use during invocation.\r\n * @return The result of the function invocation.\r\n */\r\n public invokeWithDynamicDependencies(\r\n container: Container,\r\n fn: DependencyCtorOrFunctor,\r\n staticDependencies: TArgs[number][],\r\n dynamicDependencies: TArgs[number][]\r\n ): ImplOrAny {\r\n let i = staticDependencies.length;\r\n let args = new Array(i);\r\n\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n\r\n return (fn as DependencyFunctor).apply(undefined, args as TArgs) as ImplOrAny;\r\n }\r\n}\r\n\r\nFactoryInvoker.instance = new FactoryInvoker();\r\n","import './internal';\r\nimport { Resolver } from './resolvers';\r\nimport { Container } from './container';\r\nimport { metadata } from 'aurelia-metadata';\r\nimport {\r\n DependencyCtorOrFunctor,\r\n PrimitiveOrDependencyCtor,\r\n Impl,\r\n Args,\r\n DependencyCtor\r\n} from './types';\r\n\r\n/**\r\n * Decorator: Specifies a custom registration strategy for the decorated\r\n * class/function.\r\n */\r\nexport function registration, TArgs extends Args>(\r\n value: Registration) {\r\n return (target: DependencyCtor) => {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"transient\"\r\n * lifetime.\r\n */\r\nexport function transient, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor) {\r\n return registration(new TransientRegistration(key));\r\n}\r\n\r\n/**\r\n * Decorator: Specifies to register the decorated item with a \"singleton\"\r\n * lifetime.\r\n */\r\nexport function singleton(registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n key?: PrimitiveOrDependencyCtor, registerInChild?: boolean);\r\nexport function singleton, TArgs extends Args>(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean, registerInChild: boolean = false) {\r\n return registration(\r\n new SingletonRegistration(keyOrRegisterInChild, registerInChild)\r\n );\r\n}\r\n\r\n/**\r\n * Customizes how a particular function is resolved by the Container.\r\n */\r\nexport interface Registration<\r\n TBase,\r\n TImpl extends Impl,\r\n TArgs extends Args> {\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver;\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * transients with the container.\r\n */\r\nexport class TransientRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of TransientRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(key?: PrimitiveOrDependencyCtor) {\r\n this._key = key;\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient(\r\n (this._key || key) as string,\r\n fn as DependencyCtorOrFunctor)\r\n : existingResolver;\r\n }\r\n}\r\n\r\n/**\r\n * Used to allow functions/classes to indicate that they should be registered as\r\n * singletons with the container.\r\n */\r\nexport class SingletonRegistration, TArgs extends Args>\r\n implements Registration {\r\n /** @internal */\r\n public _registerInChild: boolean;\r\n\r\n /** @internal */\r\n public _key?: PrimitiveOrDependencyCtor;\r\n\r\n /**\r\n * Creates an instance of SingletonRegistration.\r\n * @param key The key to register as.\r\n */\r\n constructor(\r\n keyOrRegisterInChild?: PrimitiveOrDependencyCtor | boolean,\r\n registerInChild: boolean = false) {\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n } else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n\r\n /**\r\n * Called by the container to register the resolver.\r\n * @param container The container the resolver is being registered with.\r\n * @param key The key the resolver should be registered as.\r\n * @param fn The function to create the resolver for.\r\n * @return The resolver that was registered.\r\n */\r\n public registerResolver(\r\n container: Container,\r\n key: PrimitiveOrDependencyCtor,\r\n fn: DependencyCtorOrFunctor\r\n ): Resolver {\r\n const targetContainer = this._registerInChild ? container : container.root;\r\n const existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n }\r\n}\r\n"],"names":["metadata","protocol","Strategy","AggregateError"],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;AAsCA;IACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;IAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACnI,SAAS,KAAK,IAAI,CAAC,GAAG,U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AoB,CAAC;aAC9C;iBAAM;IACL,YAAA,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACjC,YAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;aACzC;SACF;IASM,IAAA,qBAAA,CAAA,SAAA,CAAA,gBAAgB,GAAvB,UACE,SAAoB,EACpB,GAAmD,EACnD,EAAgD,EAAA;IAEhD,QAAA,IAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;IAC3E,QAAA,IAAM,gBAAgB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;YACvE,OAAO,gBAAgB,KAAK,SAAS;IACnC,cAAE,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;kBACvD,gBAAgB,CAAC;SACtB,CAAA;QACH,OAAC,qBAAA,CAAA;IAAD,CAAC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index fb770af..8245798 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,8 +1,14 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. - - +# Changelog + +All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. + +## [1.6.0](https://github.com/aurelia/dependency-injection/compare/1.5.2...1.6.0) (2024-08-11) + + +### Features + +* backport resolve ([#228](https://github.com/aurelia/dependency-injection/issues/228)) ([ccac164](https://github.com/aurelia/dependency-injection/commit/ccac164c511274a5b37db441cdfea924c92b37fd)) + ## [1.5.2](https://github.com/aurelia/dependency-injection/compare/1.5.1...1.5.2) (2019-11-20) diff --git a/doc/api.json b/doc/api.json index f8aea81..4b47609 100644 --- a/doc/api.json +++ b/doc/api.json @@ -1 +1 @@ -{"name":"aurelia-dependency-injection","children":[{"id":7,"name":"Strategy","kind":4,"kindString":"Enumeration","flags":{"isExported":true},"children":[{"id":13,"name":"alias","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":56,"character":6}],"defaultValue":"5"},{"id":12,"name":"array","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":55,"character":6}],"defaultValue":"4"},{"id":11,"name":"function","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":54,"character":9}],"defaultValue":"3"},{"id":8,"name":"instance","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":51,"character":9}],"defaultValue":"0"},{"id":9,"name":"singleton","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":52,"character":10}],"defaultValue":"1"},{"id":10,"name":"transient","kind":16,"kindString":"Enumeration member","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":53,"character":10}],"defaultValue":"2"}],"groups":[{"title":"Enumeration members","kind":16,"children":[13,12,11,8,9,10]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":50,"character":28}]},{"id":58,"name":"All","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":59,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":60,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":61,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":62,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":63,"name":"new All","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":64,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"All","id":58}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":81,"character":115}]},{"id":65,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":66,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":67,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"array","elementType":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":83,"character":4}]},{"id":68,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":69,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":70,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":71,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":72,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":73,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"All","id":58,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":84,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[62]},{"title":"Methods","kind":2048,"children":[65,68]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":81,"character":24}]},{"id":198,"name":"Container","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":202,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":203,"name":"new Container","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":204,"name":"configuration","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"ContainerConfiguration","id":192}}],"type":{"type":"reference","name":"Container","id":198}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":156,"character":17}]},{"id":200,"name":"parent","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":155,"character":7}],"type":{"type":"reference","name":"Container","id":198}},{"id":201,"name":"root","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":156,"character":5}],"type":{"type":"reference","name":"Container","id":198}},{"id":199,"name":"instance","kind":1024,"kindString":"Property","flags":{"isStatic":true,"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":154,"character":16}],"type":{"type":"reference","name":"Container","id":198}},{"id":337,"name":"_createInvocationHandler","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":338,"name":"_createInvocationHandler","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":339,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":340,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":341,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":342,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":343,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":344,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":181,"character":8}],"type":{"type":"intrinsic","name":"any"}}],"groups":[{"title":"Variables","kind":32,"children":[344]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":180,"character":165}]}}]}}],"type":{"type":"reference","name":"InvocationHandler","id":176,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":180,"character":25}]},{"id":319,"name":"_get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":320,"name":"_get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":321,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":176,"character":5}]},{"id":275,"name":"autoRegister","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":276,"name":"autoRegister","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":277,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":278,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":279,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":280,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Primitive","id":379}},{"id":281,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}},{"id":282,"name":"autoRegister","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":283,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":284,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":285,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":286,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":287,"name":"fn","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":168,"character":13},{"fileName":"aurelia-dependency-injection.d.ts","line":169,"character":13}]},{"id":288,"name":"autoRegisterAll","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":289,"name":"autoRegisterAll","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":290,"name":"fns","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"array","elementType":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}]}}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":170,"character":16}]},{"id":328,"name":"createChild","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":329,"name":"createChild","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":178,"character":12}]},{"id":308,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":309,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":310,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":311,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":312,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":313,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":314,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":315,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":316,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":317,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":318,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"reference","name":"Container","id":198}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":174,"character":4},{"fileName":"aurelia-dependency-injection.d.ts","line":175,"character":4}]},{"id":322,"name":"getAll","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":323,"name":"getAll","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":324,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":325,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":326,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":327,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"array","elementType":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":177,"character":7}]},{"id":301,"name":"getResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":302,"name":"getResolver","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":303,"name":"TStrategyKey","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","name":"StrategyState","typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl"},{"type":"typeParameter","name":"TArgs"}]}}},{"id":304,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":305,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":306,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":307,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"StrategyResolver","id":25,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TStrategyKey","constraint":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","name":"StrategyState","typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl"},{"type":"typeParameter","name":"TArgs"}]}}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":173,"character":12}]},{"id":294,"name":"hasResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":295,"name":"hasResolver","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":296,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":297,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":298,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":299,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":300,"name":"checkParent","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"intrinsic","name":"boolean"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":172,"character":12}]},{"id":330,"name":"invoke","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":331,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":332,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":333,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":334,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":335,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":336,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":179,"character":7}]},{"id":205,"name":"makeGlobal","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":206,"name":"makeGlobal","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":158,"character":11}]},{"id":261,"name":"registerAlias","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":262,"name":"registerAlias","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":263,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":264,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":265,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":266,"name":"originalKey","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":267,"name":"aliasKey","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":166,"character":14}]},{"id":249,"name":"registerHandler","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":250,"name":"registerHandler","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":251,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":252,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":253,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":254,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":255,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":256,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":257,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":258,"name":"container","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"Container","id":198}},{"id":259,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":260,"name":"resolver","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"Resolver","id":2}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":165,"character":167}]}}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":165,"character":16}]},{"id":216,"name":"registerInstance","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":217,"name":"registerInstance","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":218,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":219,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":220,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":221,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":222,"name":"instance","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":160,"character":17}]},{"id":268,"name":"registerResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":269,"name":"registerResolver","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":270,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":271,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":272,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":273,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":274,"name":"resolver","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Resolver","id":2}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":167,"character":17}]},{"id":223,"name":"registerSingleton","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":224,"name":"registerSingleton","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":225,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":226,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":227,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":228,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Primitive","id":379}},{"id":229,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}},{"id":230,"name":"registerSingleton","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":231,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":232,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":233,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":234,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":235,"name":"fn","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":161,"character":18},{"fileName":"aurelia-dependency-injection.d.ts","line":162,"character":18}]},{"id":236,"name":"registerTransient","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":237,"name":"registerTransient","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":238,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":239,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":240,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":241,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Primitive","id":379}},{"id":242,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}},{"id":243,"name":"registerTransient","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":244,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":245,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":246,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":247,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":248,"name":"fn","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":163,"character":18},{"fileName":"aurelia-dependency-injection.d.ts","line":164,"character":18}]},{"id":207,"name":"setHandlerCreatedCallback","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":208,"name":"setHandlerCreatedCallback","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":209,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":210,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":211,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":212,"name":"onHandlerCreated","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":213,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":214,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":215,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"InvocationHandler","id":176,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"InvocationHandler","id":176,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":159,"character":133}]}}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":159,"character":26}]},{"id":291,"name":"unregister","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":292,"name":"unregister","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":293,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":171,"character":11}]}],"groups":[{"title":"Constructors","kind":512,"children":[202]},{"title":"Properties","kind":1024,"children":[200,201,199]},{"title":"Methods","kind":2048,"children":[337,319,275,288,328,308,322,301,294,330,205,261,249,216,268,223,236,207,291]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":153,"character":30}]},{"id":108,"name":"Factory","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":109,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":110,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":111,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":112,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":113,"name":"new Factory","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":114,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Factory","id":108}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":96,"character":119}]},{"id":115,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":116,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":117,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"reference","name":"DependencyFunctor","id":400,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":98,"character":4}]},{"id":118,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":119,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":120,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":121,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":122,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":123,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Factory","id":108,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":99,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[112]},{"title":"Methods","kind":2048,"children":[115,118]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":96,"character":28}]},{"id":160,"name":"FactoryInvoker","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":161,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":162,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":163,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":164,"name":"instance","kind":1024,"kindString":"Property","flags":{"isStatic":true,"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":137,"character":16}],"type":{"type":"reference","name":"FactoryInvoker","id":160,"typeArguments":[{"type":"intrinsic","name":"any"}]}},{"id":165,"name":"invoke","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":166,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":167,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":168,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":169,"name":"dependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},"implementationOf":{"type":"reference","name":"Invoker.invoke","id":150}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":138,"character":7}],"implementationOf":{"type":"reference","name":"Invoker.invoke","id":149}},{"id":170,"name":"invokeWithDynamicDependencies","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":171,"name":"invokeWithDynamicDependencies","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":172,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":173,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":174,"name":"staticDependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}},{"id":175,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},"implementationOf":{"type":"reference","name":"Invoker.invokeWithDynamicDependencies","id":155}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":139,"character":30}],"implementationOf":{"type":"reference","name":"Invoker.invokeWithDynamicDependencies","id":154}}],"groups":[{"title":"Properties","kind":1024,"children":[164]},{"title":"Methods","kind":2048,"children":[165,170]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":136,"character":35}],"implementedTypes":[{"type":"reference","name":"Invoker","id":145,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}]},{"id":176,"name":"InvocationHandler","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":177,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":178,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":179,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":183,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":184,"name":"new InvocationHandler","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":185,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":186,"name":"invoker","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Invoker","id":145,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":187,"name":"dependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"type":{"type":"reference","name":"InvocationHandler","id":176}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":145,"character":21}]},{"id":182,"name":"dependencies","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":145,"character":13}],"type":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}},{"id":180,"name":"fn","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":143,"character":3}],"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":181,"name":"invoker","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":144,"character":8}],"type":{"type":"reference","name":"Invoker","id":145,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":188,"name":"invoke","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":189,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":190,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":191,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"array","elementType":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}}],"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":147,"character":7}]}],"groups":[{"title":"Constructors","kind":512,"children":[183]},{"title":"Properties","kind":1024,"children":[182,180,181]},{"title":"Methods","kind":2048,"children":[188]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":142,"character":38}]},{"id":40,"name":"Lazy","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":41,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":42,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":43,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":44,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":45,"name":"new Lazy","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":46,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Lazy","id":40}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":76,"character":116}]},{"id":47,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":48,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":49,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"reflection","declaration":{"id":50,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":51,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":78,"character":27}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":78,"character":4}]},{"id":52,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":53,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":54,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":55,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":56,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":57,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Lazy","id":40,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":79,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[44]},{"title":"Methods","kind":2048,"children":[47,52]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":76,"character":25}]},{"id":124,"name":"NewInstance","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":125,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":126,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":127,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":128,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":129,"name":"new NewInstance","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":130,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":131,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reference","name":"NewInstance","id":124}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":101,"character":123}]},{"id":135,"name":"as","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":136,"name":"as","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":137,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"intrinsic","name":"this"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":104,"character":3}]},{"id":132,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":133,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":134,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":103,"character":4}]},{"id":138,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":139,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":140,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":141,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":142,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":143,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":144,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reference","name":"NewInstance","id":124,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":105,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[128]},{"title":"Methods","kind":2048,"children":[135,132,138]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":101,"character":32}]},{"id":74,"name":"Optional","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":75,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":76,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":77,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":78,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":79,"name":"new Optional","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":80,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":81,"name":"checkParent","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","name":"Optional","id":74}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":86,"character":120}]},{"id":82,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":83,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":84,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":88,"character":4}]},{"id":85,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":86,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":87,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":88,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":89,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":90,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":91,"name":"checkParent","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","name":"Optional","id":74,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":89,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[78]},{"title":"Methods","kind":2048,"children":[82,85]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":86,"character":29}]},{"id":92,"name":"Parent","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":93,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":94,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":95,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":96,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":97,"name":"new Parent","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":98,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Parent","id":92}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":91,"character":118}]},{"id":99,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":100,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":101,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}}],"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":93,"character":4}]},{"id":102,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":103,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":104,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":105,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":106,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":107,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Parent","id":92,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":94,"character":10}]}],"groups":[{"title":"Constructors","kind":512,"children":[96]},{"title":"Methods","kind":2048,"children":[99,102]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":91,"character":27}]},{"id":366,"name":"SingletonRegistration","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":367,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":368,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":369,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":370,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":371,"name":"new SingletonRegistration","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":372,"name":"keyOrRegisterInChild","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"union","types":[{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"intrinsic","name":"boolean"}]}},{"id":373,"name":"registerInChild","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","name":"SingletonRegistration","id":366}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":200,"character":150}]},{"id":374,"name":"registerResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":375,"name":"registerResolver","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":376,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":377,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":378,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2},"implementationOf":{"type":"reference","name":"Registration.registerResolver","id":350}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":202,"character":17}],"implementationOf":{"type":"reference","name":"Registration.registerResolver","id":349}}],"groups":[{"title":"Constructors","kind":512,"children":[370]},{"title":"Methods","kind":2048,"children":[374]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":200,"character":42}],"implementedTypes":[{"type":"reference","name":"Registration","id":345,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}]},{"id":25,"name":"StrategyResolver","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":26,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":27,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":28,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":29,"name":"TStrategyKey","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","name":"StrategyState","typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl"},{"type":"typeParameter","name":"TArgs"}]}}}],"children":[{"id":32,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":33,"name":"new StrategyResolver","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":34,"name":"strategy","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"typeParameter","name":"TStrategyKey","constraint":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","name":"StrategyState","typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl"},{"type":"typeParameter","name":"TArgs"}]}}}},{"id":35,"name":"state","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"unknown","name":"StrategyState[TStrategyKey]"}}],"type":{"type":"reference","name":"StrategyResolver","id":25}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":72,"character":85}]},{"id":31,"name":"state","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":72,"character":6}],"type":{"type":"intrinsic","name":"any"}},{"id":30,"name":"strategy","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":71,"character":9}],"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","name":"StrategyState","typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}},{"id":36,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":37,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":38,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":39,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":74,"character":4}]}],"groups":[{"title":"Constructors","kind":512,"children":[32]},{"title":"Properties","kind":1024,"children":[31,30]},{"title":"Methods","kind":2048,"children":[36]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":70,"character":37}]},{"id":354,"name":"TransientRegistration","kind":128,"kindString":"Class","flags":{"isExported":true},"typeParameter":[{"id":355,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":356,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":357,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":358,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":359,"name":"new TransientRegistration","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":360,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"TransientRegistration","id":354}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":196,"character":150}]},{"id":361,"name":"registerResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":362,"name":"registerResolver","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":363,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":364,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":365,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2},"implementationOf":{"type":"reference","name":"Registration.registerResolver","id":350}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":198,"character":17}],"implementationOf":{"type":"reference","name":"Registration.registerResolver","id":349}}],"groups":[{"title":"Constructors","kind":512,"children":[358]},{"title":"Methods","kind":2048,"children":[361]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":196,"character":42}],"implementedTypes":[{"type":"reference","name":"Registration","id":345,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}]},{"id":192,"name":"ContainerConfiguration","kind":256,"kindString":"Interface","flags":{"isExported":true},"children":[{"id":197,"name":"handlers","kind":1024,"kindString":"Property","flags":{"isExported":true,"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":151,"character":9}],"type":{"type":"reference","name":"Map","typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}]}},{"id":193,"name":"onHandlerCreated","kind":1024,"kindString":"Property","flags":{"isExported":true,"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":150,"character":17}],"type":{"type":"reflection","declaration":{"id":194,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":195,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":196,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"InvocationHandler","id":176,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}]}}],"type":{"type":"reference","name":"InvocationHandler","id":176,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":150,"character":19}]}}}],"groups":[{"title":"Properties","kind":1024,"children":[197,193]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":149,"character":39}]},{"id":145,"name":"Invoker","kind":256,"kindString":"Interface","flags":{"isExported":true},"typeParameter":[{"id":146,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":147,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":148,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":149,"name":"invoke","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":150,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":151,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":152,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":153,"name":"dependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":133,"character":7}]},{"id":154,"name":"invokeWithDynamicDependencies","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":155,"name":"invokeWithDynamicDependencies","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":156,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":157,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":158,"name":"staticDependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}},{"id":159,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reference","name":"ImplOrAny","id":407,"typeArguments":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":134,"character":30}]}],"groups":[{"title":"Methods","kind":2048,"children":[149,154]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":132,"character":24}],"implementedBy":[{"type":"reference","name":"FactoryInvoker","id":160}]},{"id":345,"name":"Registration","kind":256,"kindString":"Interface","flags":{"isExported":true},"typeParameter":[{"id":346,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":347,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":348,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":349,"name":"registerResolver","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":350,"name":"registerResolver","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":351,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":352,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":353,"name":"fn","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtorOrFunctor","id":409,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reference","name":"Resolver","id":2}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":194,"character":17}]}],"groups":[{"title":"Methods","kind":2048,"children":[349]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":193,"character":29}],"implementedBy":[{"type":"reference","name":"SingletonRegistration","id":366},{"type":"reference","name":"TransientRegistration","id":354}]},{"id":2,"name":"Resolver","kind":256,"kindString":"Interface","flags":{"isExported":true},"children":[{"id":3,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":4,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":5,"name":"container","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Container","id":198}},{"id":6,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":48,"character":4}]}],"groups":[{"title":"Methods","kind":2048,"children":[3]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":47,"character":25}]},{"id":14,"name":"StrategyState","kind":256,"kindString":"Interface","flags":{"isExported":true},"typeParameter":[{"id":15,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":16,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":17,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"children":[{"id":18,"name":"__computed","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":61,"character":20},{"fileName":"aurelia-dependency-injection.d.ts","line":62,"character":21},{"fileName":"aurelia-dependency-injection.d.ts","line":63,"character":21},{"fileName":"aurelia-dependency-injection.d.ts","line":64,"character":20},{"fileName":"aurelia-dependency-injection.d.ts","line":65,"character":17},{"fileName":"aurelia-dependency-injection.d.ts","line":68,"character":17}],"type":{"type":"intrinsic","name":"any"}}],"groups":[{"title":"Properties","kind":1024,"children":[18]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":60,"character":30}]},{"id":391,"name":"Args","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":392,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":12,"character":16}],"type":{"type":"union","types":[{"type":"reference","name":"CtorArgs","id":383,"typeArguments":[{"type":"typeParameter","name":"TBase"}]},{"type":"reference","name":"FuncArgs","id":387,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}]}},{"id":383,"name":"CtorArgs","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":384,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":8,"character":20}],"type":{"type":"unknown","name":"CtorArgs"}},{"id":385,"name":"CtorImpl","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":386,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":9,"character":20}],"type":{"type":"unknown","name":"CtorImpl"}},{"id":395,"name":"DependencyCtor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":396,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":397,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":398,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":14,"character":26}],"type":{"type":"reflection","declaration":{"id":399,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":18,"character":5}]}}},{"id":409,"name":"DependencyCtorOrFunctor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":410,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":411,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":412,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":25,"character":35}],"type":{"type":"union","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reference","name":"DependencyFunctor","id":400,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}]}},{"id":400,"name":"DependencyFunctor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":401,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":402,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":403,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":19,"character":29}],"type":{"type":"reflection","declaration":{"id":404,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":405,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":406,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"type":{"type":"union","types":[{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":23,"character":5}]}}},{"id":387,"name":"FuncArgs","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":388,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":10,"character":20}],"type":{"type":"unknown","name":"FuncArgs"}},{"id":389,"name":"FuncReturns","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":390,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":11,"character":23}],"type":{"type":"unknown","name":"FuncReturns"}},{"id":429,"name":"IStrategy","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":58,"character":29}],"type":{"type":"union","types":[{"type":"unknown","name":"1"},{"type":"unknown","name":"2"},{"type":"unknown","name":"3"},{"type":"unknown","name":"4"},{"type":"unknown","name":"5"}]}},{"id":393,"name":"Impl","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":394,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":13,"character":16}],"type":{"type":"union","types":[{"type":"reference","name":"CtorImpl","id":385,"typeArguments":[{"type":"typeParameter","name":"TBase"}]},{"type":"reference","name":"FuncReturns","id":389,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}]}},{"id":407,"name":"ImplOrAny","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":408,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":24,"character":21}],"type":{"type":"unknown","name":"ImplOrAny"}},{"id":544,"name":"Injectable","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":184,"character":30}],"type":{"type":"intersection","types":[{"type":"reference","name":"Function"},{"type":"reflection","declaration":{"id":545,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":546,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":185,"character":7}],"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"reflection","declaration":{"id":547,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":548,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":185,"character":17}]}}]}}],"groups":[{"title":"Variables","kind":32,"children":[546]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":184,"character":43}]}}]}},{"id":379,"name":"Primitive","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":1,"character":21}],"type":{"type":"union","types":[{"type":"intrinsic","name":"boolean"},{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"number"},{"type":"intrinsic","name":"symbol"},{"type":"intrinsic","name":"any"},{"type":"reflection","declaration":{"id":380,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":381,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":382,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":6,"character":3}]}},{"type":"reference","name":"Array","typeArguments":[{"type":"intrinsic","name":"any"}]}]}},{"id":413,"name":"PrimitiveOrDependencyCtor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":414,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":415,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":416,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":30,"character":37}],"type":{"type":"union","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reference","name":"Primitive","id":379}]}},{"id":417,"name":"PrimitiveOrDependencyCtorOrFunctor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":418,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":419,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":420,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":35,"character":46}],"type":{"type":"union","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reference","name":"DependencyFunctor","id":400,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reference","name":"Primitive","id":379}]}},{"id":430,"name":"StrategyFunctor","kind":4194304,"kindString":"Type alias","flags":{"isExported":true},"typeParameter":[{"id":431,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":432,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":433,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":59,"character":35}],"type":{"type":"reflection","declaration":{"id":434,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":435,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":436,"name":"container","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"Container","id":198}},{"id":437,"name":"ctor","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"PrimitiveOrDependencyCtorOrFunctor","id":417,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":438,"name":"strategyResolver","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":59,"character":126}]}}},{"id":543,"name":"_emptyParameters","kind":32,"kindString":"Variable","flags":{"isExported":true,"isConst":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":141,"character":37}],"type":{"type":"tuple"}},{"id":421,"name":"resolver","kind":32,"kindString":"Variable","flags":{"isExported":true,"isConst":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":42,"character":29}],"type":{"type":"intersection","types":[{"type":"reflection","declaration":{"id":422,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":423,"name":"decorates","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":43,"character":10}],"type":{"type":"reflection","declaration":{"id":424,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":425,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":426,"name":"key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"boolean"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":43,"character":12}]}}}],"groups":[{"title":"Variables","kind":32,"children":[423]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":42,"character":30}]}},{"type":"reflection","declaration":{"id":427,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":428,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":46,"character":3}]}}]}},{"id":460,"name":"all","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":461,"name":"all","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":462,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":463,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":464,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":465,"name":"keyValue","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":466,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":467,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":468,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":469,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":470,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":114,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[470]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":113,"character":179}]}}]}},{"id":471,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":472,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":113,"character":132}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":113,"character":27}]},{"id":549,"name":"autoinject","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":550,"name":"autoinject","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":551,"name":"TPotential","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":552,"name":"potentialTarget","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"typeParameter","name":"TPotential"}}],"type":{"type":"unknown","name":"TPotential extends Injectable ? void : (target: Injectable) => void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":187,"character":34}]},{"id":496,"name":"factory","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":497,"name":"factory","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":498,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":499,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":500,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":501,"name":"keyValue","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":502,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":503,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":504,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":505,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":506,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":123,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[506]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":122,"character":183}]}}]}},{"id":507,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":508,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":122,"character":136}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":122,"character":31}]},{"id":439,"name":"getDecoratorDependencies","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":440,"name":"getDecoratorDependencies","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":441,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":442,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":443,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":444,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":445,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":446,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":108,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[446]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":107,"character":183}]}}]}}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":107,"character":48}]},{"id":553,"name":"inject","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":554,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":555,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":556,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":557,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":558,"name":"rest","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":188,"character":30}]},{"id":534,"name":"invokeAsFactory","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":535,"name":"invokeAsFactory","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":536,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":537,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":538,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":539,"name":"potentialTarget","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"void"},{"type":"reflection","declaration":{"id":540,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":541,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":542,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":131,"character":163}]}}]}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":131,"character":39}]},{"id":525,"name":"invoker","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":526,"name":"invoker","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":527,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":528,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":529,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":530,"name":"value","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Invoker","id":145,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reflection","declaration":{"id":531,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":532,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":533,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":130,"character":130}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":130,"character":31}]},{"id":447,"name":"lazy","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":448,"name":"lazy","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":449,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":450,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":451,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":452,"name":"keyValue","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":453,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":454,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":455,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":456,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":457,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":111,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[457]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":110,"character":180}]}}]}},{"id":458,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":459,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":110,"character":133}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":110,"character":28}]},{"id":509,"name":"newInstance","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":510,"name":"newInstance","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":511,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":512,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":513,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":514,"name":"asKeyOrTarget","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intersection","types":[{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":515,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":516,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":126,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[516]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":125,"character":189}]}}]}},{"id":517,"name":"dynamicDependencies","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"type":{"type":"reflection","declaration":{"id":518,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":519,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":520,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":521,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":522,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":128,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[522]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":127,"character":91}]}}]}},{"id":523,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":524,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":127,"character":44}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":125,"character":35}]},{"id":473,"name":"optional","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":474,"name":"optional","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":475,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":476,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":477,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":478,"name":"checkParentOrTarget","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reflection","declaration":{"id":479,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":480,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":481,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":482,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":483,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":117,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[483]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":116,"character":200}]}}]}},{"id":484,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":485,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":116,"character":153}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":116,"character":32}]},{"id":486,"name":"parent","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":487,"name":"parent","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":488,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":489,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":490,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":491,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intersection","types":[{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]},{"type":"reflection","declaration":{"id":492,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":493,"name":"inject","kind":32,"kindString":"Variable","flags":{"isOptional":true},"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":120,"character":7}],"type":{"type":"array","elementType":{"type":"unknown","name":"TArgs[number]"}}}],"groups":[{"title":"Variables","kind":32,"children":[493]}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":119,"character":165}]}}]}},{"id":494,"name":"_key","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":495,"name":"index","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":119,"character":30}]},{"id":559,"name":"registration","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":560,"name":"registration","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":561,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":562,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":563,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":564,"name":"value","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"Registration","id":345,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reflection","declaration":{"id":565,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":566,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":567,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":189,"character":140}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":189,"character":36}]},{"id":577,"name":"singleton","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":578,"name":"singleton","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":579,"name":"registerInChild","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"intrinsic","name":"any"}},{"id":580,"name":"singleton","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":581,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":582,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":583,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":584,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}},{"id":585,"name":"registerInChild","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":191,"character":33},{"fileName":"aurelia-dependency-injection.d.ts","line":192,"character":33}]},{"id":568,"name":"transient","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":569,"name":"transient","kind":4096,"kindString":"Call signature","flags":{},"typeParameter":[{"id":570,"name":"TBase","kind":131072,"kindString":"Type parameter","flags":{}},{"id":571,"name":"TImpl","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"id":572,"name":"TArgs","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}],"parameters":[{"id":573,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","name":"PrimitiveOrDependencyCtor","id":413,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"reflection","declaration":{"id":574,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":575,"name":"__call","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":576,"name":"target","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","name":"DependencyCtor","id":395,"typeArguments":[{"type":"typeParameter","name":"TBase"},{"type":"typeParameter","name":"TImpl","constraint":{"type":"reference","name":"Impl","id":393,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}},{"type":"typeParameter","name":"TArgs","constraint":{"type":"reference","name":"Args","id":391,"typeArguments":[{"type":"typeParameter","name":"TBase"}]}}]}}],"type":{"type":"intrinsic","name":"void"}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":190,"character":149}]}}}],"sources":[{"fileName":"aurelia-dependency-injection.d.ts","line":190,"character":33}]}],"groups":[{"title":"Enumerations","kind":4,"children":[7]},{"title":"Classes","kind":128,"children":[58,198,108,160,176,40,124,74,92,366,25,354]},{"title":"Interfaces","kind":256,"children":[192,145,345,2,14]},{"title":"Type aliases","kind":4194304,"children":[391,383,385,395,409,400,387,389,429,393,407,544,379,413,417,430]},{"title":"Variables","kind":32,"children":[543,421]},{"title":"Functions","kind":64,"children":[460,549,496,439,553,534,525,447,509,473,486,559,577,568]}]} +{"id":0,"name":"aurelia-dependency-injection","variant":"project","kind":1,"flags":{},"children":[{"id":446,"name":"Strategy","variant":"declaration","kind":8,"flags":{},"children":[{"id":452,"name":"alias","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":51,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L51"}],"type":{"type":"literal","value":5}},{"id":451,"name":"array","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":50,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L50"}],"type":{"type":"literal","value":4}},{"id":450,"name":"function","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":49,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L49"}],"type":{"type":"literal","value":3}},{"id":447,"name":"instance","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":46,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L46"}],"type":{"type":"literal","value":0}},{"id":448,"name":"singleton","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":47,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L47"}],"type":{"type":"literal","value":1}},{"id":449,"name":"transient","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"resolvers.ts","line":48,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L48"}],"type":{"type":"literal","value":2}}],"groups":[{"title":"Enumeration Members","children":[452,451,450,447,448,449]}],"sources":[{"fileName":"resolvers.ts","line":45,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L45"}]},{"id":521,"name":"All","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to specify resolution of all matches to a key."}]},"children":[{"id":528,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":227,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L227"}],"signatures":[{"id":529,"name":"new All","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the All class."}]},"sources":[{"fileName":"resolvers.ts","line":227,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L227"}],"typeParameters":[{"id":530,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":531,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":532,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":533,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to lazily resolve all matches for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true},{"type":"reference","target":531,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"All.TImpl","refersToTypeParameter":true},{"type":"reference","target":532,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"All.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":521,"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true},{"type":"reference","target":531,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"All.TImpl","refersToTypeParameter":true},{"type":"reference","target":532,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"All.TArgs","refersToTypeParameter":true}],"name":"All","package":"aurelia-dependency-injection"}}]},{"id":535,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":221,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L221"}],"type":{"type":"literal","value":"all"}},{"id":536,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":237,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L237"}],"signatures":[{"id":537,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to resolve all matching dependencies as an array of\r\ninstances."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an array of all matching instances."}]}]},"sources":[{"fileName":"resolvers.ts","line":237,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L237"}],"parameters":[{"id":538,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"array","elementType":{"type":"reference","target":531,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"All.TImpl","refersToTypeParameter":true}}}]},{"id":522,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":246,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L246"}],"signatures":[{"id":523,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an All Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of All for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":246,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L246"}],"typeParameters":[{"id":524,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":525,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":524,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":526,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":524,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":527,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve all instances for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":524,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":525,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":526,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":521,"typeArguments":[{"type":"reference","target":524,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":525,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":526,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"All","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[528]},{"title":"Properties","children":[535]},{"title":"Methods","children":[536,522]}],"sources":[{"fileName":"resolvers.ts","line":210,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L210"}],"typeParameters":[{"id":539,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":540,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":541,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":530,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"All.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":34,"name":"Container","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"A lightweight, extensible dependency injection container."}]},"children":[{"id":36,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"container.ts","line":206,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L206"}],"signatures":[{"id":37,"name":"new Container","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of Container."}]},"sources":[{"fileName":"container.ts","line":206,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L206"}],"parameters":[{"id":38,"name":"configuration","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Provides some configuration for the new Container instance."}]},"type":{"type":"reference","target":28,"name":"ContainerConfiguration","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}]},{"id":39,"name":"parent","variant":"declaration","kind":1024,"flags":{"isPublic":true},"comment":{"summary":[{"kind":"text","text":"The parent container in the DI hierarchy."}]},"sources":[{"fileName":"container.ts","line":181,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L181"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}]}},{"id":40,"name":"root","variant":"declaration","kind":1024,"flags":{"isPublic":true},"comment":{"summary":[{"kind":"text","text":"The root container in the DI hierarchy."}]},"sources":[{"fileName":"container.ts","line":186,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L186"}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":35,"name":"instance","variant":"declaration","kind":1024,"flags":{"isPublic":true,"isStatic":true},"comment":{"summary":[{"kind":"text","text":"The global root Container instance. Available if makeGlobal() has been\r\ncalled. Aurelia Framework calls makeGlobal()."}]},"sources":[{"fileName":"container.ts","line":176,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L176"}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":184,"name":"_createInvocationHandler","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":583,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L583"}],"signatures":[{"id":185,"name":"_createInvocationHandler","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":583,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L583"}],"typeParameters":[{"id":186,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":187,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":186,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":188,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":186,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":189,"name":"fn","variant":"param","kind":32768,"flags":{},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":186,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":187,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":188,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":190,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":191,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"container.ts","line":585,"character":59,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L585"}],"type":{"type":"intrinsic","name":"any"}}],"groups":[{"title":"Properties","children":[191]}],"sources":[{"fileName":"container.ts","line":585,"character":57,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L585"}]}}]}}],"type":{"type":"reference","target":9,"typeArguments":[{"type":"reference","target":186,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":187,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":188,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}]},{"id":166,"name":"_get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":495,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L495"}],"signatures":[{"id":167,"name":"_get","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":495,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L495"}],"parameters":[{"id":168,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}]},{"id":118,"name":"autoRegister","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":376,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L376"},{"fileName":"container.ts","line":378,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L378"},{"fileName":"container.ts","line":380,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L380"}],"signatures":[{"id":119,"name":"autoRegister","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers a type (constructor function) by inspecting its registration\r\nannotations. If none are found, then the default singleton registration is\r\nused."}]},"sources":[{"fileName":"container.ts","line":376,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L376"}],"typeParameters":[{"id":120,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":121,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":120,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":122,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":120,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":123,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Primitive"},"name":"Primitive","package":"aurelia-dependency-injection"}},{"id":124,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor function to use when the dependency needs to be\r\ninstantiated. This defaults to the key value when fn is not supplied."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":120,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":121,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":122,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}},{"id":125,"name":"autoRegister","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":378,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L378"}],"typeParameters":[{"id":126,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":127,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":126,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":128,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":126,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":129,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":126,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":127,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":128,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}},{"id":130,"name":"fn","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":126,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":127,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":128,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":131,"name":"autoRegisterAll","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":403,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L403"}],"signatures":[{"id":132,"name":"autoRegisterAll","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers an array of types (constructor functions) by inspecting their\r\nregistration annotations. If none are found, then the default singleton\r\nregistration is used."}]},"sources":[{"fileName":"container.ts","line":403,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L403"}],"parameters":[{"id":133,"name":"fns","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor function to use when the dependency needs to be instantiated."}]},"type":{"type":"array","elementType":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":175,"name":"createChild","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":547,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L547"}],"signatures":[{"id":176,"name":"createChild","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new dependency injection container whose parent is the current container."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns a new container instance parented to this."}]}]},"sources":[{"fileName":"container.ts","line":547,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L547"}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}]},{"id":151,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":457,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L457"},{"fileName":"container.ts","line":459,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L459"},{"fileName":"container.ts","line":461,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L461"},{"fileName":"container.ts","line":463,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L463"}],"signatures":[{"id":152,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves a single instance based on the provided key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the resolved instance."}]}]},"sources":[{"fileName":"container.ts","line":457,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L457"}],"typeParameters":[{"id":153,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":154,"name":"TResolver","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"reference","target":608,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"NewInstance","package":"aurelia-dependency-injection"},{"type":"reference","target":498,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"Lazy","package":"aurelia-dependency-injection"},{"type":"reference","target":587,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"Factory","package":"aurelia-dependency-injection"},{"type":"reference","target":542,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"Optional","package":"aurelia-dependency-injection"},{"type":"reference","target":566,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"Parent","package":"aurelia-dependency-injection"},{"type":"reference","target":521,"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":153,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"All","package":"aurelia-dependency-injection"}]}}],"parameters":[{"id":155,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the object to resolve."}]},"type":{"type":"reference","target":154,"name":"TResolver","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"reference","target":192,"typeArguments":[{"type":"reference","target":154,"name":"TResolver","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ResolvedValue","package":"aurelia-dependency-injection"}},{"id":156,"name":"get","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":459,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L459"}],"typeParameters":[{"id":157,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":158,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":157,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":159,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":157,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":160,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":157,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":158,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":159,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":158,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}},{"id":161,"name":"get","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":461,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L461"}],"typeParameters":[{"id":162,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":163,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":162,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":164,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":162,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":165,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"query","queryType":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}]},{"id":169,"name":"getAll","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":514,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L514"}],"signatures":[{"id":170,"name":"getAll","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves all instance registered under the provided key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an array of the resolved instances."}]}]},"sources":[{"fileName":"container.ts","line":514,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L514"}],"typeParameters":[{"id":171,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":172,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":171,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":173,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":171,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":174,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the objects to resolve."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":171,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":172,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":173,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"array","elementType":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":172,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}}]},{"id":144,"name":"getResolver","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":441,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L441"}],"signatures":[{"id":145,"name":"getResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the resolver for the particular key, if it has been registered."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the resolver, if registred, otherwise undefined."}]}]},"sources":[{"fileName":"container.ts","line":441,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L441"}],"typeParameters":[{"id":146,"name":"TStrategyKey","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","target":463,"typeArguments":[{"type":"reference","target":147,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":148,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":149,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"StrategyState","package":"aurelia-dependency-injection"}}},{"id":147,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":148,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":147,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":149,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":147,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":150,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time; usually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":147,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":148,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":149,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":479,"typeArguments":[{"type":"reference","target":147,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":148,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":149,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":146,"name":"TStrategyKey","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"StrategyResolver","package":"aurelia-dependency-injection"}}]},{"id":137,"name":"hasResolver","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":424,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L424"}],"signatures":[{"id":138,"name":"hasResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Inspects the container to determine if a particular key has been registred."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns true if the key has been registred; false otherwise."}]}]},"sources":[{"fileName":"container.ts","line":424,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L424"}],"typeParameters":[{"id":139,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":140,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":139,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":141,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":139,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":142,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time; usually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":139,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":140,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":141,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":143,"name":"checkParent","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Indicates whether or not to check the parent container hierarchy."}]},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"boolean"}}]},{"id":177,"name":"invoke","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":560,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L560"}],"signatures":[{"id":178,"name":"invoke","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes a function, recursively resolving its dependencies."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the instance resulting from calling the function."}]}]},"sources":[{"fileName":"container.ts","line":560,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L560"}],"typeParameters":[{"id":179,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":180,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":179,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":181,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":179,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":182,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The function to invoke with the auto-resolved dependencies."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":179,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":180,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":181,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":183,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Additional function dependencies to use during invocation."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":181,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":180,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}]},{"id":48,"name":"makeGlobal","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":223,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L223"}],"signatures":[{"id":49,"name":"makeGlobal","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Makes this container instance globally reachable through Container.instance."}]},"sources":[{"fileName":"container.ts","line":223,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L223"}],"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}]},{"id":104,"name":"registerAlias","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":330,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L330"}],"signatures":[{"id":105,"name":"registerAlias","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers an additional key that serves as an alias to the original DI key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":330,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L330"}],"typeParameters":[{"id":106,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":107,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":106,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":108,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":106,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":109,"name":"originalKey","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that originally identified the dependency; usually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":106,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":107,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":108,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":110,"name":"aliasKey","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"An alternate key which can also be used to resolve the same dependency as the original."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":106,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":107,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":108,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":92,"name":"registerHandler","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":314,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L314"}],"signatures":[{"id":93,"name":"registerHandler","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers a custom resolution function such that the container calls this\r\nfunction for each request to obtain the instance."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":314,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L314"}],"typeParameters":[{"id":94,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":95,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":94,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":96,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":94,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":97,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":94,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":95,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":96,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":98,"name":"handler","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The resolution function to use when the dependency is\r\nneeded."}]},"type":{"type":"reflection","declaration":{"id":99,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":316,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L316"}],"signatures":[{"id":100,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":316,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L316"}],"parameters":[{"id":101,"name":"container","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":102,"name":"key","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":94,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":95,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":96,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":103,"name":"resolver","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":59,"name":"registerInstance","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":254,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L254"}],"signatures":[{"id":60,"name":"registerInstance","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers an existing object instance with the container."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":254,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L254"}],"typeParameters":[{"id":61,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":62,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":61,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":63,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":61,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":64,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":61,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":62,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":63,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":65,"name":"instance","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The instance that will be resolved when the key is matched.\r\nThis defaults to the key value when instance is not supplied."}]},"type":{"type":"reference","target":62,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":111,"name":"registerResolver","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":347,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L347"}],"signatures":[{"id":112,"name":"registerResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers a custom resolution function such that the container calls this\r\nfunction for each request to obtain the instance."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":347,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L347"}],"typeParameters":[{"id":113,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":114,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":113,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":115,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":113,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":116,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":113,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":114,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":115,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":117,"name":"resolver","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The resolver to use when the dependency is needed."}]},"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":66,"name":"registerSingleton","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":272,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L272"},{"fileName":"container.ts","line":274,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L274"},{"fileName":"container.ts","line":276,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L276"}],"signatures":[{"id":67,"name":"registerSingleton","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers a type (constructor function) such that the container always\r\nreturns the same instance for each request."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":272,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L272"}],"typeParameters":[{"id":68,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":69,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":68,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":70,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":68,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":71,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Primitive"},"name":"Primitive","package":"aurelia-dependency-injection"}},{"id":72,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor function to use when the dependency needs to be\r\ninstantiated. This defaults to the key value when fn is not supplied."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":68,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":69,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":70,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}},{"id":73,"name":"registerSingleton","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":274,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L274"}],"typeParameters":[{"id":74,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":75,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":74,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":76,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":74,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":77,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":74,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":75,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":76,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}},{"id":78,"name":"fn","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":74,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":75,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":76,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":79,"name":"registerTransient","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":293,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L293"},{"fileName":"container.ts","line":295,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L295"},{"fileName":"container.ts","line":297,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L297"}],"signatures":[{"id":80,"name":"registerTransient","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Registers a type (constructor function) such that the container returns a\r\nnew instance for each request."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"container.ts","line":293,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L293"}],"typeParameters":[{"id":81,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":82,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":81,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":83,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":81,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":84,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time;\r\nusually a constructor function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Primitive"},"name":"Primitive","package":"aurelia-dependency-injection"}},{"id":85,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor function to use when the dependency needs to be\r\ninstantiated. This defaults to the key value when fn is not supplied."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":81,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":82,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":83,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}},{"id":86,"name":"registerTransient","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":295,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L295"}],"typeParameters":[{"id":87,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":88,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":87,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":89,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":87,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":90,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":87,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":88,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":89,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}},{"id":91,"name":"fn","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":87,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":88,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":89,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]},{"id":50,"name":"setHandlerCreatedCallback","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":234,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L234"}],"signatures":[{"id":51,"name":"setHandlerCreatedCallback","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Sets an invocation handler creation callback that will be called when new\r\nInvocationsHandlers are created (called once per Function)."}]},"sources":[{"fileName":"container.ts","line":234,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L234"}],"typeParameters":[{"id":52,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":53,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":52,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":54,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":52,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":55,"name":"onHandlerCreated","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The callback to be called when an\r\nInvocationsHandler is created."}]},"type":{"type":"reflection","declaration":{"id":56,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":238,"character":24,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L238"}],"signatures":[{"id":57,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":238,"character":24,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L238"}],"parameters":[{"id":58,"name":"handler","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":9,"typeArguments":[{"type":"reference","target":52,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":53,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":54,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":9,"typeArguments":[{"type":"reference","target":52,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":53,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":54,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":134,"name":"unregister","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":414,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L414"}],"signatures":[{"id":135,"name":"unregister","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Unregisters based on key."}]},"sources":[{"fileName":"container.ts","line":414,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L414"}],"parameters":[{"id":136,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that identifies the dependency at resolution time; usually a constructor function."}]},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Constructors","children":[36]},{"title":"Properties","children":[39,40,35]},{"title":"Methods","children":[184,166,118,131,175,151,169,144,137,177,48,104,92,59,111,66,79,50,134]}],"sources":[{"fileName":"container.ts","line":171,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L171"}]},{"id":587,"name":"Factory","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow injecting dependencies but also passing data to the constructor."}]},"children":[{"id":594,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":386,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L386"}],"signatures":[{"id":595,"name":"new Factory","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the Factory class."}]},"sources":[{"fileName":"resolvers.ts","line":386,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L386"}],"typeParameters":[{"id":596,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":597,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":598,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":599,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve from the parent container."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true},{"type":"reference","target":597,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Factory.TImpl","refersToTypeParameter":true},{"type":"reference","target":598,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Factory.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":587,"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true},{"type":"reference","target":597,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Factory.TImpl","refersToTypeParameter":true},{"type":"reference","target":598,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Factory.TArgs","refersToTypeParameter":true}],"name":"Factory","package":"aurelia-dependency-injection"}}]},{"id":601,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":380,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L380"}],"type":{"type":"literal","value":"factory"}},{"id":602,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":397,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L397"}],"signatures":[{"id":603,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to pass the dependencies to the constructor."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns a function that can be invoked to resolve dependencies\r\nlater, and the rest of the parameters."}]}]},"sources":[{"fileName":"resolvers.ts","line":397,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L397"}],"parameters":[{"id":604,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to invoke the constructor with dependencies\r\nand other parameters."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyFunctor"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true},{"type":"reference","target":597,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Factory.TImpl","refersToTypeParameter":true},{"type":"reference","target":598,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Factory.TArgs","refersToTypeParameter":true}],"name":"DependencyFunctor","package":"aurelia-dependency-injection"}}]},{"id":588,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":412,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L412"}],"signatures":[{"id":589,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a Factory Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of Factory for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":412,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L412"}],"typeParameters":[{"id":590,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":591,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":590,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":592,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":590,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":593,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":590,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":591,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":592,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":587,"typeArguments":[{"type":"reference","target":590,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":591,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":592,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Factory","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[594]},{"title":"Properties","children":[601]},{"title":"Methods","children":[602,588]}],"sources":[{"fileName":"resolvers.ts","line":369,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L369"}],"typeParameters":[{"id":605,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":606,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":607,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":596,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Factory.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":253,"name":"FactoryInvoker","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"An Invoker that is used to invoke a factory method."}]},"children":[{"id":255,"name":"constructor","variant":"declaration","kind":512,"flags":{},"signatures":[{"id":256,"name":"new FactoryInvoker","variant":"signature","kind":16384,"flags":{},"typeParameters":[{"id":257,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":258,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":259,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":253,"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true},{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}],"name":"FactoryInvoker","package":"aurelia-dependency-injection"}}]},{"id":254,"name":"instance","variant":"declaration","kind":1024,"flags":{"isPublic":true,"isStatic":true},"comment":{"summary":[{"kind":"text","text":"The singleton instance of the FactoryInvoker."}]},"sources":[{"fileName":"invokers.ts","line":74,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L74"}],"type":{"type":"reference","target":253,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"intrinsic","name":"any"}],"name":"Args","package":"aurelia-dependency-injection"}],"name":"FactoryInvoker","package":"aurelia-dependency-injection"}},{"id":260,"name":"invoke","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"invokers.ts","line":83,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L83"}],"signatures":[{"id":261,"name":"invoke","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes the function with the provided dependencies."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The result of the function invocation."}]}]},"sources":[{"fileName":"invokers.ts","line":83,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L83"}],"parameters":[{"id":262,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The calling container."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":263,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor or factory function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true},{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":264,"name":"dependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The dependencies of the function call."}]},"type":{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"},"implementationOf":{"type":"reference","target":240,"name":"Invoker.invoke"}}],"implementationOf":{"type":"reference","target":239,"name":"Invoker.invoke"}},{"id":265,"name":"invokeWithDynamicDependencies","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"invokers.ts","line":106,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L106"}],"signatures":[{"id":266,"name":"invokeWithDynamicDependencies","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes the function with the provided dependencies."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The result of the function invocation."}]}]},"sources":[{"fileName":"invokers.ts","line":106,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L106"}],"parameters":[{"id":267,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The calling container."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":268,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor or factory function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true},{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":269,"name":"staticDependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The static dependencies of the function."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}}}},{"id":270,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Additional dependencies to use during invocation."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}}}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"},"implementationOf":{"type":"reference","target":245,"name":"Invoker.invokeWithDynamicDependencies"}}],"implementationOf":{"type":"reference","target":244,"name":"Invoker.invokeWithDynamicDependencies"}}],"groups":[{"title":"Constructors","children":[255]},{"title":"Properties","children":[254]},{"title":"Methods","children":[260,265]}],"sources":[{"fileName":"invokers.ts","line":66,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L66"}],"typeParameters":[{"id":271,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":272,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":273,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"implementedTypes":[{"type":"reference","target":238,"typeArguments":[{"type":"reference","target":257,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TBase","refersToTypeParameter":true},{"type":"reference","target":258,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":259,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"FactoryInvoker.TArgs","refersToTypeParameter":true}],"name":"Invoker","package":"aurelia-dependency-injection"}]},{"id":9,"name":"InvocationHandler","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Stores the information needed to invoke a function."}]},"children":[{"id":10,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"container.ts","line":64,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L64"}],"signatures":[{"id":11,"name":"new InvocationHandler","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Instantiates an InvocationDescription."}]},"sources":[{"fileName":"container.ts","line":64,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L64"}],"typeParameters":[{"id":12,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":13,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":14,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":15,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The Function described by this description object."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true},{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true},{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":16,"name":"invoker","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The strategy for invoking the function."}]},"type":{"type":"reference","target":238,"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true},{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true},{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}],"name":"Invoker","package":"aurelia-dependency-injection"}},{"id":17,"name":"dependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The static dependencies of the function call."}]},"type":{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}}],"type":{"type":"reference","target":9,"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true},{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true},{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}]},{"id":20,"name":"dependencies","variant":"declaration","kind":1024,"flags":{"isPublic":true},"comment":{"summary":[{"kind":"text","text":"The statically known dependencies of this function invocation."}]},"sources":[{"fileName":"container.ts","line":56,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L56"}],"type":{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}},{"id":18,"name":"fn","variant":"declaration","kind":1024,"flags":{"isPublic":true},"comment":{"summary":[{"kind":"text","text":"The function to be invoked by this handler."}]},"sources":[{"fileName":"container.ts","line":46,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L46"}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true},{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true},{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":19,"name":"invoker","variant":"declaration","kind":1024,"flags":{"isPublic":true},"comment":{"summary":[{"kind":"text","text":"The invoker implementation that will be used to actually invoke the function."}]},"sources":[{"fileName":"container.ts","line":51,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L51"}],"type":{"type":"reference","target":238,"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true},{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true},{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}],"name":"Invoker","package":"aurelia-dependency-injection"}},{"id":21,"name":"invoke","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"container.ts","line":80,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L80"}],"signatures":[{"id":22,"name":"invoke","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes the function."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The result of the function invocation."}]}]},"sources":[{"fileName":"container.ts","line":80,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L80"}],"parameters":[{"id":23,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The calling container."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":24,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Additional dependencies to use during invocation."}]},"type":{"type":"array","elementType":{"type":"reference","target":14,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TArgs","refersToTypeParameter":true}}}],"type":{"type":"reference","target":13,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TImpl","refersToTypeParameter":true}}]}],"groups":[{"title":"Constructors","children":[10]},{"title":"Properties","children":[20,18,19]},{"title":"Methods","children":[21]}],"sources":[{"fileName":"container.ts","line":38,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L38"}],"typeParameters":[{"id":25,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":26,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":27,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":12,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"InvocationHandler.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":498,"name":"Lazy","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to specify lazy resolution logic."}]},"children":[{"id":505,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":176,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L176"}],"signatures":[{"id":506,"name":"new Lazy","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the Lazy class."}]},"sources":[{"fileName":"resolvers.ts","line":176,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L176"}],"typeParameters":[{"id":507,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":508,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":509,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":510,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to lazily resolve."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true},{"type":"reference","target":508,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TImpl","refersToTypeParameter":true},{"type":"reference","target":509,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":498,"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true},{"type":"reference","target":508,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TImpl","refersToTypeParameter":true},{"type":"reference","target":509,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TArgs","refersToTypeParameter":true}],"name":"Lazy","package":"aurelia-dependency-injection"}}]},{"id":512,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":170,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L170"}],"type":{"type":"literal","value":"lazy"}},{"id":513,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":187,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L187"}],"signatures":[{"id":514,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to lazily resolve the dependency into a lazy locator\r\nfunction."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns a function which can be invoked at a later time to obtain\r\nthe actual dependency."}]}]},"sources":[{"fileName":"resolvers.ts","line":187,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L187"}],"parameters":[{"id":515,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"reflection","declaration":{"id":516,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":187,"character":36,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L187"}],"signatures":[{"id":517,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":187,"character":36,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L187"}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":508,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}]}}}]},{"id":499,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":196,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L196"}],"signatures":[{"id":500,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a Lazy Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of Lazy for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":196,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L196"}],"typeParameters":[{"id":501,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":502,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":501,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":503,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":501,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":504,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to lazily resolve."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":501,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":502,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":503,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":498,"typeArguments":[{"type":"reference","target":501,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":502,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":503,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Lazy","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[505]},{"title":"Properties","children":[512]},{"title":"Methods","children":[513,499]}],"sources":[{"fileName":"resolvers.ts","line":159,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L159"}],"typeParameters":[{"id":518,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":519,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":520,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":507,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Lazy.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":608,"name":"NewInstance","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to inject a new instance of a dependency, without regard for existing\r\ninstances in the container. Instances can optionally be registered in the\r\ncontainer\r\nunder a different key by supplying a key using the "},{"kind":"code","text":"`as`"},{"kind":"text","text":" method."}]},"children":[{"id":616,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":451,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L451"}],"signatures":[{"id":617,"name":"new NewInstance","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the NewInstance class."}]},"sources":[{"fileName":"resolvers.ts","line":451,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L451"}],"typeParameters":[{"id":618,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":619,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":620,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":621,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve/instantiate."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true},{"type":"reference","target":619,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TImpl","refersToTypeParameter":true},{"type":"reference","target":620,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":622,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"An optional list of dynamic dependencies."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":620,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TArgs","refersToTypeParameter":true}}}}],"type":{"type":"reference","target":608,"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true},{"type":"reference","target":619,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TImpl","refersToTypeParameter":true},{"type":"reference","target":620,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TArgs","refersToTypeParameter":true}],"name":"NewInstance","package":"aurelia-dependency-injection"}}]},{"id":626,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":444,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L444"}],"type":{"type":"literal","value":"newInstance"}},{"id":630,"name":"as","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":491,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L491"}],"signatures":[{"id":631,"name":"as","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Instructs the NewInstance resolver to register the resolved instance using\r\nthe supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the NewInstance resolver."}]}]},"sources":[{"fileName":"resolvers.ts","line":491,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L491"}],"parameters":[{"id":632,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to register the instance with."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true},{"type":"reference","target":619,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TImpl","refersToTypeParameter":true},{"type":"reference","target":620,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":608,"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true},{"type":"reference","target":619,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TImpl","refersToTypeParameter":true},{"type":"reference","target":620,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TArgs","refersToTypeParameter":true}],"name":"NewInstance","package":"aurelia-dependency-injection"}}]},{"id":627,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":464,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L464"}],"signatures":[{"id":628,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to instantiate the dependency and potentially\r\nregister\r\nas another key if the "},{"kind":"code","text":"`as`"},{"kind":"text","text":" method was used."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the matching instance from the parent container"}]}]},"sources":[{"fileName":"resolvers.ts","line":464,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L464"}],"parameters":[{"id":629,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve the parent from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":619,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}]},{"id":609,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":502,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L502"}],"signatures":[{"id":610,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an NewInstance Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of NewInstance for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":502,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L502"}],"typeParameters":[{"id":611,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":612,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":611,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":613,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":611,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":614,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve/instantiate."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":611,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":612,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":613,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":615,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"An optional list of dynamic dependencies."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":613,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"type":{"type":"reference","target":608,"typeArguments":[{"type":"reference","target":611,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":612,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":613,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"NewInstance","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[616]},{"title":"Properties","children":[626]},{"title":"Methods","children":[630,627,609]}],"sources":[{"fileName":"resolvers.ts","line":428,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L428"}],"typeParameters":[{"id":633,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":634,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":635,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":618,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"NewInstance.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":542,"name":"Optional","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to specify an optional dependency, which will\r\nbe resolved only if already registred with the container."}]},"children":[{"id":550,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":282,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L282"}],"signatures":[{"id":551,"name":"new Optional","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the Optional class."}]},"sources":[{"fileName":"resolvers.ts","line":282,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L282"}],"typeParameters":[{"id":552,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":553,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":554,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":555,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to optionally resolve for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true},{"type":"reference","target":553,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Optional.TImpl","refersToTypeParameter":true},{"type":"reference","target":554,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Optional.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":556,"name":"checkParent","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Indicates whether or not the parent container hierarchy\r\nshould be checked."}]},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"true"}],"type":{"type":"reference","target":542,"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true},{"type":"reference","target":553,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Optional.TImpl","refersToTypeParameter":true},{"type":"reference","target":554,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Optional.TArgs","refersToTypeParameter":true}],"name":"Optional","package":"aurelia-dependency-injection"}}]},{"id":559,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":274,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L274"}],"type":{"type":"literal","value":"optional"}},{"id":560,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":292,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L292"}],"signatures":[{"id":561,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to provide optional resolution of the key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the instance if found; otherwise null."}]}]},"sources":[{"fileName":"resolvers.ts","line":292,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L292"}],"parameters":[{"id":562,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","target":553,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Optional.TImpl","refersToTypeParameter":true}]}}]},{"id":543,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":307,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L307"}],"signatures":[{"id":544,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an Optional Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of Optional for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":307,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L307"}],"typeParameters":[{"id":545,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":546,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":545,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":547,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":545,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":548,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to optionally resolve for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":545,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":546,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":547,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":549,"name":"checkParent","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Indicates whether or not the parent container\r\nhierarchy should be checked."}]},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"true"}],"type":{"type":"reference","target":542,"typeArguments":[{"type":"reference","target":545,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":546,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":547,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Optional","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[550]},{"title":"Properties","children":[559]},{"title":"Methods","children":[560,543]}],"sources":[{"fileName":"resolvers.ts","line":260,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L260"}],"typeParameters":[{"id":563,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":564,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":565,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":552,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Optional.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":566,"name":"Parent","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to inject the dependency from the parent container instead of the current\r\none."}]},"children":[{"id":573,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":338,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L338"}],"signatures":[{"id":574,"name":"new Parent","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the Parent class."}]},"sources":[{"fileName":"resolvers.ts","line":338,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L338"}],"typeParameters":[{"id":575,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":576,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":577,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":578,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve from the parent container."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true},{"type":"reference","target":576,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Parent.TImpl","refersToTypeParameter":true},{"type":"reference","target":577,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Parent.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":566,"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true},{"type":"reference","target":576,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Parent.TImpl","refersToTypeParameter":true},{"type":"reference","target":577,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Parent.TArgs","refersToTypeParameter":true}],"name":"Parent","package":"aurelia-dependency-injection"}}]},{"id":580,"name":"__resolver_type__","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"A non existent property to help TS distinguish resolvers\r\n\r\nThis is semi-private, and should not be used by application"}]},"sources":[{"fileName":"resolvers.ts","line":332,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L332"}],"type":{"type":"literal","value":"parent"}},{"id":581,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":347,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L347"}],"signatures":[{"id":582,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to load the dependency from the parent container"}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the matching instance from the parent container"}]}]},"sources":[{"fileName":"resolvers.ts","line":347,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L347"}],"parameters":[{"id":583,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve the parent from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","target":576,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Parent.TImpl","refersToTypeParameter":true}]}}]},{"id":567,"name":"of","variant":"declaration","kind":2048,"flags":{"isPublic":true,"isStatic":true},"sources":[{"fileName":"resolvers.ts","line":356,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L356"}],"signatures":[{"id":568,"name":"of","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a Parent Resolver for the supplied key."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns an instance of Parent for the key."}]}]},"sources":[{"fileName":"resolvers.ts","line":356,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L356"}],"typeParameters":[{"id":569,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":570,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":569,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":571,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":569,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":572,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key to resolve."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":569,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":570,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":571,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":566,"typeArguments":[{"type":"reference","target":569,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":570,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":571,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Parent","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Constructors","children":[573]},{"title":"Properties","children":[580]},{"title":"Methods","children":[581,567]}],"sources":[{"fileName":"resolvers.ts","line":321,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L321"}],"typeParameters":[{"id":584,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":585,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":586,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":575,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Parent.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":326,"name":"SingletonRegistration","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to indicate that they should be registered as\r\nsingletons with the container."}]},"children":[{"id":327,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"registrations.ts","line":122,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L122"}],"signatures":[{"id":328,"name":"new SingletonRegistration","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of SingletonRegistration."}]},"sources":[{"fileName":"registrations.ts","line":122,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L122"}],"typeParameters":[{"id":329,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":330,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":331,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":332,"name":"keyOrRegisterInChild","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":330,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":331,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":333,"name":"registerInChild","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"reference","target":326,"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":330,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":331,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TArgs","refersToTypeParameter":true}],"name":"SingletonRegistration","package":"aurelia-dependency-injection"}}]},{"id":336,"name":"registerResolver","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"registrations.ts","line":140,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L140"}],"signatures":[{"id":337,"name":"registerResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to register the resolver."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"registrations.ts","line":140,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L140"}],"parameters":[{"id":338,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container the resolver is being registered with."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":339,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key the resolver should be registered as."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":330,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":331,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":340,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The function to create the resolver for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":330,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":331,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"},"implementationOf":{"type":"reference","target":303,"name":"Registration.registerResolver"}}],"implementationOf":{"type":"reference","target":302,"name":"Registration.registerResolver"}}],"groups":[{"title":"Constructors","children":[327]},{"title":"Methods","children":[336]}],"sources":[{"fileName":"registrations.ts","line":110,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L110"}],"typeParameters":[{"id":341,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":342,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":343,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"implementedTypes":[{"type":"reference","target":301,"typeArguments":[{"type":"reference","target":329,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":330,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":331,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"SingletonRegistration.TArgs","refersToTypeParameter":true}],"name":"Registration","package":"aurelia-dependency-injection"}]},{"id":479,"name":"StrategyResolver","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to resolve instances, singletons, transients, aliases"}]},"children":[{"id":480,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":117,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L117"}],"signatures":[{"id":481,"name":"new StrategyResolver","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of the StrategyResolver class."}]},"sources":[{"fileName":"resolvers.ts","line":117,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L117"}],"typeParameters":[{"id":482,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":483,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":484,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}},{"id":485,"name":"TStrategyKey","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","target":463,"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true}],"name":"StrategyState","package":"aurelia-dependency-injection"}}}],"parameters":[{"id":486,"name":"strategy","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The type of resolution strategy."}]},"type":{"type":"reference","target":485,"name":"TStrategyKey","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TStrategyKey","refersToTypeParameter":true}},{"id":487,"name":"state","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The state associated with the resolution strategy."}]},"type":{"type":"indexedAccess","indexType":{"type":"reference","target":485,"name":"TStrategyKey","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TStrategyKey","refersToTypeParameter":true},"objectType":{"type":"reference","target":463,"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true}],"name":"StrategyState","package":"aurelia-dependency-injection"}}}],"type":{"type":"reference","target":479,"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true},{"type":"reference","target":485,"name":"TStrategyKey","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TStrategyKey","refersToTypeParameter":true}],"name":"StrategyResolver","package":"aurelia-dependency-injection"}}]},{"id":489,"name":"state","variant":"declaration","kind":1024,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":110,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L110"}],"type":{"type":"intrinsic","name":"any"}},{"id":488,"name":"strategy","variant":"declaration","kind":1024,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":109,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L109"}],"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","target":463,"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true}],"name":"StrategyState","package":"aurelia-dependency-injection"}}},{"id":490,"name":"get","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"resolvers.ts","line":129,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L129"}],"signatures":[{"id":491,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to allow custom resolution of dependencies for a\r\nfunction/class."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the resolved object."}]}]},"sources":[{"fileName":"resolvers.ts","line":129,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L129"}],"parameters":[{"id":492,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":493,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that the resolver was registered as."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true}}]}],"groups":[{"title":"Constructors","children":[480]},{"title":"Properties","children":[489,488]},{"title":"Methods","children":[490]}],"sources":[{"fileName":"resolvers.ts","line":103,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L103"}],"typeParameters":[{"id":494,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":495,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":496,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}},{"id":497,"name":"TStrategyKey","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"typeOperator","operator":"keyof","target":{"type":"reference","target":463,"typeArguments":[{"type":"reference","target":482,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TBase","refersToTypeParameter":true},{"type":"reference","target":483,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TImpl","refersToTypeParameter":true},{"type":"reference","target":484,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyResolver.TArgs","refersToTypeParameter":true}],"name":"StrategyState","package":"aurelia-dependency-injection"}}}]},{"id":310,"name":"TransientRegistration","variant":"declaration","kind":128,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to indicate that they should be registered as\r\ntransients with the container."}]},"children":[{"id":311,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"registrations.ts","line":81,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L81"}],"signatures":[{"id":312,"name":"new TransientRegistration","variant":"signature","kind":16384,"flags":{},"comment":{"summary":[{"kind":"text","text":"Creates an instance of TransientRegistration."}]},"sources":[{"fileName":"registrations.ts","line":81,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L81"}],"typeParameters":[{"id":313,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":314,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":315,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":316,"name":"key","variant":"param","kind":32768,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The key to register as."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":314,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":315,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":310,"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":314,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":315,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TArgs","refersToTypeParameter":true}],"name":"TransientRegistration","package":"aurelia-dependency-injection"}}]},{"id":318,"name":"registerResolver","variant":"declaration","kind":2048,"flags":{"isPublic":true},"sources":[{"fileName":"registrations.ts","line":92,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L92"}],"signatures":[{"id":319,"name":"registerResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to register the resolver."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"registrations.ts","line":92,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L92"}],"parameters":[{"id":320,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container the resolver is being registered with."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":321,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key the resolver should be registered as."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":314,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":315,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":322,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The function to create the resolver for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":314,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":315,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"},"implementationOf":{"type":"reference","target":303,"name":"Registration.registerResolver"}}],"implementationOf":{"type":"reference","target":302,"name":"Registration.registerResolver"}}],"groups":[{"title":"Constructors","children":[311]},{"title":"Methods","children":[318]}],"sources":[{"fileName":"registrations.ts","line":72,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L72"}],"typeParameters":[{"id":323,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":324,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":325,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"implementedTypes":[{"type":"reference","target":301,"typeArguments":[{"type":"reference","target":313,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TBase","refersToTypeParameter":true},{"type":"reference","target":314,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TImpl","refersToTypeParameter":true},{"type":"reference","target":315,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"TransientRegistration.TArgs","refersToTypeParameter":true}],"name":"Registration","package":"aurelia-dependency-injection"}]},{"id":28,"name":"ContainerConfiguration","variant":"declaration","kind":256,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to configure a Container instance."}]},"children":[{"id":33,"name":"handlers","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"container.ts","line":110,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L110"}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es2015.collection.d.ts","qualifiedName":"Map"},"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}],"name":"Map","package":"typescript"}},{"id":29,"name":"onHandlerCreated","variant":"declaration","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"An optional callback which will be called when any function needs an\r\nInvocationHandler created (called once per Function)."}]},"sources":[{"fileName":"container.ts","line":106,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L106"}],"type":{"type":"reflection","declaration":{"id":30,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":106,"character":21,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L106"}],"signatures":[{"id":31,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":106,"character":21,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L106"}],"parameters":[{"id":32,"name":"handler","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":9,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":9,"typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}],"name":"InvocationHandler","package":"aurelia-dependency-injection"}}]}}}],"groups":[{"title":"Properties","children":[33,29]}],"sources":[{"fileName":"container.ts","line":101,"character":17,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L101"}]},{"id":238,"name":"Invoker","variant":"declaration","kind":256,"flags":{},"comment":{"summary":[{"kind":"text","text":"A strategy for invoking a function, resulting in an object instance."}]},"children":[{"id":239,"name":"invoke","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"invokers.ts","line":41,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L41"}],"signatures":[{"id":240,"name":"invoke","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes the function with the provided dependencies."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The result of the function invocation."}]}]},"sources":[{"fileName":"invokers.ts","line":41,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L41"}],"parameters":[{"id":241,"name":"container","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":242,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor or factory function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":250,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TBase","refersToTypeParameter":true},{"type":"reference","target":251,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":252,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":243,"name":"dependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The dependencies of the function call."}]},"type":{"type":"reference","target":252,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TArgs","refersToTypeParameter":true}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":251,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}]},{"id":244,"name":"invokeWithDynamicDependencies","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"invokers.ts","line":55,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L55"}],"signatures":[{"id":245,"name":"invokeWithDynamicDependencies","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invokes the function with the provided dependencies."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The result of the function invocation."}]}]},"sources":[{"fileName":"invokers.ts","line":55,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L55"}],"parameters":[{"id":246,"name":"container","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":247,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The constructor or factory function."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":250,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TBase","refersToTypeParameter":true},{"type":"reference","target":251,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TImpl","refersToTypeParameter":true},{"type":"reference","target":252,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":248,"name":"staticDependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The static dependencies of the function."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":252,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TArgs","refersToTypeParameter":true}}}},{"id":249,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Additional dependencies to use during\r\ninvocation."}]},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":252,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TArgs","refersToTypeParameter":true}}}}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"ImplOrAny"},"typeArguments":[{"type":"reference","target":251,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TImpl","refersToTypeParameter":true}],"name":"ImplOrAny","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Methods","children":[239,244]}],"sources":[{"fileName":"invokers.ts","line":34,"character":17,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L34"}],"typeParameters":[{"id":250,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":251,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":250,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":252,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":250,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Invoker.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"implementedBy":[{"type":"reference","target":253,"name":"FactoryInvoker"}]},{"id":301,"name":"Registration","variant":"declaration","kind":256,"flags":{},"comment":{"summary":[{"kind":"text","text":"Customizes how a particular function is resolved by the Container."}]},"children":[{"id":302,"name":"registerResolver","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"registrations.ts","line":61,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L61"}],"signatures":[{"id":303,"name":"registerResolver","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to register the resolver."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The resolver that was registered."}]}]},"sources":[{"fileName":"registrations.ts","line":61,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L61"}],"parameters":[{"id":304,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container the resolver is being registered with."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":305,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key the resolver should be registered as."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":307,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Registration.TBase","refersToTypeParameter":true},{"type":"reference","target":308,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Registration.TImpl","refersToTypeParameter":true},{"type":"reference","target":309,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Registration.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":306,"name":"fn","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The function to create the resolver for."}]},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":307,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Registration.TBase","refersToTypeParameter":true},{"type":"reference","target":308,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"Registration.TImpl","refersToTypeParameter":true},{"type":"reference","target":309,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"Registration.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":441,"name":"Resolver","package":"aurelia-dependency-injection"}}]}],"groups":[{"title":"Methods","children":[302]}],"sources":[{"fileName":"registrations.ts","line":50,"character":17,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L50"}],"typeParameters":[{"id":307,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":308,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":307,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Registration.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":309,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":307,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"Registration.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"implementedBy":[{"type":"reference","target":326,"name":"SingletonRegistration"},{"type":"reference","target":310,"name":"TransientRegistration"}]},{"id":441,"name":"Resolver","variant":"declaration","kind":256,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used to allow functions/classes to specify custom dependency resolution logic."}]},"children":[{"id":442,"name":"get","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"resolvers.ts","line":42,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L42"}],"signatures":[{"id":443,"name":"get","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Called by the container to allow custom resolution of dependencies for a\r\nfunction/class."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the resolved object."}]}]},"sources":[{"fileName":"resolvers.ts","line":42,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L42"}],"parameters":[{"id":444,"name":"container","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The container to resolve from."}]},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":445,"name":"key","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The key that the resolver was registered as."}]},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}]}],"groups":[{"title":"Methods","children":[442]}],"sources":[{"fileName":"resolvers.ts","line":34,"character":17,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L34"}]},{"id":463,"name":"StrategyState","variant":"declaration","kind":256,"flags":{},"children":[{"id":464,"name":"0","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":70,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L70"}],"type":{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true}},{"id":465,"name":"1","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":71,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L71"}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true},{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true},{"type":"reference","target":478,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":466,"name":"2","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":72,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L72"}],"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true},{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true},{"type":"reference","target":478,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TArgs","refersToTypeParameter":true}],"name":"DependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":467,"name":"3","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":73,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L73"}],"type":{"type":"reference","target":454,"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true},{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true},{"type":"reference","target":478,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TArgs","refersToTypeParameter":true}],"name":"StrategyFunctor","package":"aurelia-dependency-injection"}},{"id":468,"name":"4","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"For typings purposes, this is done as ({ get: StrategyFunctor } | TImpl)[]\r\nBut it should be understood, and used as [{ get: StrategyFunctor }, ...TImp[]]"}]},"sources":[{"fileName":"resolvers.ts","line":78,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L78"}],"type":{"type":"array","elementType":{"type":"union","types":[{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true},{"type":"reflection","declaration":{"id":469,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":470,"name":"get","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":79,"character":4,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L79"}],"type":{"type":"reflection","declaration":{"id":471,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":79,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L79"}],"signatures":[{"id":472,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":79,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L79"}],"parameters":[{"id":473,"name":"container","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":474,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true},{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true},{"type":"reference","target":478,"name":"TArgs","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TArgs","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reference","target":477,"name":"TImpl","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TImpl","refersToTypeParameter":true}}]}}}],"groups":[{"title":"Properties","children":[470]}],"sources":[{"fileName":"resolvers.ts","line":78,"character":21,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L78"}]}}]}}},{"id":475,"name":"5","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"resolvers.ts","line":84,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L84"}],"type":{"type":"intrinsic","name":"any"}}],"groups":[{"title":"Properties","children":[464,465,466,467,468,475]}],"sources":[{"fileName":"resolvers.ts","line":65,"character":17,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L65"}],"typeParameters":[{"id":476,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":477,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":478,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":476,"name":"TBase","package":"aurelia-dependency-injection","qualifiedName":"StrategyState.TBase","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}]},{"id":453,"name":"IStrategy","variant":"declaration","kind":2097152,"flags":{},"sources":[{"fileName":"resolvers.ts","line":53,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L53"}],"type":{"type":"union","types":[{"type":"literal","value":1},{"type":"literal","value":2},{"type":"literal","value":3},{"type":"literal","value":4},{"type":"literal","value":5}]}},{"id":215,"name":"Injectable","variant":"declaration","kind":2097152,"flags":{},"sources":[{"fileName":"injection.ts","line":6,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L6"}],"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Function"},"name":"Function","package":"typescript"},{"type":"reflection","declaration":{"id":216,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":217,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"injection.ts","line":6,"character":38,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L6"}],"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"reflection","declaration":{"id":218,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"injection.ts","line":6,"character":56,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L6"}],"signatures":[{"id":219,"name":"__type","variant":"signature","kind":4096,"flags":{},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}]}}]}}],"groups":[{"title":"Properties","children":[217]}],"sources":[{"fileName":"injection.ts","line":6,"character":36,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L6"}]}}]}},{"id":192,"name":"ResolvedValue","variant":"declaration","kind":2097152,"flags":{},"sources":[{"fileName":"container.ts","line":610,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L610"}],"typeParameters":[{"id":201,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"type":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reflection","declaration":{"id":193,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":611,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L611"}],"signatures":[{"id":194,"name":"new ResolvedValue","variant":"signature","kind":16384,"flags":{},"sources":[{"fileName":"container.ts","line":611,"character":14,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L611"}],"parameters":[{"id":195,"name":"args","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true}}]}},"trueType":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":587,"typeArguments":[{"type":"inferred","name":"R"}],"name":"Factory","package":"aurelia-dependency-injection"},"trueType":{"type":"reflection","declaration":{"id":196,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":614,"character":8,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L614"}],"signatures":[{"id":197,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":198,"name":"args","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}}],"type":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true}}]}},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":498,"typeArguments":[{"type":"inferred","name":"R"}],"name":"Lazy","package":"aurelia-dependency-injection"},"trueType":{"type":"reflection","declaration":{"id":199,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"container.ts","line":616,"character":10,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L616"}],"signatures":[{"id":200,"name":"__type","variant":"signature","kind":4096,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true}}]}},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":608,"typeArguments":[{"type":"inferred","name":"R"}],"name":"NewInstance","package":"aurelia-dependency-injection"},"trueType":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":542,"typeArguments":[{"type":"inferred","name":"R"}],"name":"Optional","package":"aurelia-dependency-injection"},"trueType":{"type":"union","types":[{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"literal","value":null}]},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":521,"typeArguments":[{"type":"inferred","name":"R"}],"name":"All","package":"aurelia-dependency-injection"},"trueType":{"type":"array","elementType":{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true}},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":566,"typeArguments":[{"type":"inferred","name":"R"}],"name":"Parent","package":"aurelia-dependency-injection"},"trueType":{"type":"union","types":[{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"R"},"name":"R","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"literal","value":null}]},"falseType":{"type":"conditional","checkType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"tuple","elements":[{"type":"inferred","name":"T1"},{"type":"rest","elementType":{"type":"inferred","name":"T2"}}]},"trueType":{"type":"tuple","elements":[{"type":"reference","target":192,"typeArguments":[{"type":"reference","target":{"sourceFileName":"src/container.ts","qualifiedName":"T1"},"name":"T1","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ResolvedValue","package":"aurelia-dependency-injection"},{"type":"rest","elementType":{"type":"reference","target":192,"typeArguments":[{"type":"unknown","name":"..."}],"name":"ResolvedValue","package":"aurelia-dependency-injection"}}]},"falseType":{"type":"reference","target":201,"name":"T","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}}}}}}},{"id":454,"name":"StrategyFunctor","variant":"declaration","kind":2097152,"flags":{},"sources":[{"fileName":"resolvers.ts","line":55,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L55"}],"typeParameters":[{"id":460,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":461,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":460,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":460,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":462,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":460,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":460,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"type":{"type":"reflection","declaration":{"id":455,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":59,"character":6,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L59"}],"signatures":[{"id":456,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":457,"name":"container","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":458,"name":"ctor","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtorOrFunctor"},"typeArguments":[{"type":"reference","target":460,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":461,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":462,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtorOrFunctor","package":"aurelia-dependency-injection"}},{"id":459,"name":"strategyResolver","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","target":461,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}}]}}},{"id":366,"name":"all","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":551,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L551"}],"signatures":[{"id":367,"name":"all","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency should load all instances of the given\r\nkey."}]},"sources":[{"fileName":"resolvers.ts","line":551,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L551"}],"typeParameters":[{"id":368,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":369,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":368,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":370,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":368,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":371,"name":"keyValue","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":372,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":557,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L557"}],"signatures":[{"id":373,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":557,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L557"}],"parameters":[{"id":374,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":368,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":369,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":370,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":375,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":376,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":558,"character":52,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L558"}],"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":370,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"groups":[{"title":"Properties","children":[376]}],"sources":[{"fileName":"resolvers.ts","line":558,"character":50,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L558"}]}}]}},{"id":377,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":378,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":202,"name":"autoinject","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"injection.ts","line":16,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L16"}],"signatures":[{"id":203,"name":"autoinject","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Directs the TypeScript transpiler to write-out type metadata for\r\nthe decorated class."}]},"sources":[{"fileName":"injection.ts","line":16,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L16"}],"typeParameters":[{"id":204,"name":"TPotential","variant":"typeParam","kind":131072,"flags":{}}],"parameters":[{"id":205,"name":"potentialTarget","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":204,"name":"TPotential","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"conditional","checkType":{"type":"reference","target":204,"name":"TPotential","package":"aurelia-dependency-injection","refersToTypeParameter":true},"extendsType":{"type":"reference","target":215,"name":"Injectable","package":"aurelia-dependency-injection"},"trueType":{"type":"intrinsic","name":"void"},"falseType":{"type":"reflection","declaration":{"id":206,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"injection.ts","line":18,"character":42,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L18"}],"signatures":[{"id":207,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":208,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":215,"name":"Injectable","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"void"}}]}}}}]},{"id":402,"name":"factory","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":609,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L609"}],"signatures":[{"id":403,"name":"factory","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency to create a factory method, that can\r\naccept optional arguments"}]},"sources":[{"fileName":"resolvers.ts","line":609,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L609"}],"typeParameters":[{"id":404,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":405,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":404,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":406,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":404,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":407,"name":"keyValue","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":408,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":615,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L615"}],"signatures":[{"id":409,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":615,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L615"}],"parameters":[{"id":410,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":404,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":405,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":406,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":411,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":412,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":616,"character":52,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L616"}],"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":406,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"groups":[{"title":"Properties","children":[412]}],"sources":[{"fileName":"resolvers.ts","line":616,"character":50,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L616"}]}}]}},{"id":413,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":414,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":344,"name":"getDecoratorDependencies","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":517,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L517"}],"signatures":[{"id":345,"name":"getDecoratorDependencies","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Used by parameter decorators to call autoinject for the target and retrieve\r\nthe target's inject property."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"Returns the target's own inject property."}]}]},"sources":[{"fileName":"resolvers.ts","line":517,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L517"}],"typeParameters":[{"id":346,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":347,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":346,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":348,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":346,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":349,"name":"target","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The target class."}]},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":346,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":347,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":348,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":350,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":351,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":521,"character":52,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L521"}],"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":348,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"groups":[{"title":"Properties","children":[351]}],"sources":[{"fileName":"resolvers.ts","line":521,"character":50,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L521"}]}}]}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":348,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}]}}]},{"id":209,"name":"inject","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"injection.ts","line":43,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L43"}],"signatures":[{"id":210,"name":"inject","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependencies that should be injected by the DI Container into the decorated class/function."}]},"sources":[{"fileName":"injection.ts","line":43,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/injection.ts#L43"}],"typeParameters":[{"id":211,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":212,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":211,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":213,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":211,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":214,"name":"rest","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":213,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"type":{"type":"intrinsic","name":"any"}}]},{"id":229,"name":"invokeAsFactory","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"invokers.ts","line":21,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L21"}],"signatures":[{"id":230,"name":"invokeAsFactory","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies that the decorated item should be called as a factory\r\nfunction, rather than a constructor."}]},"sources":[{"fileName":"invokers.ts","line":21,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L21"}],"typeParameters":[{"id":231,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":232,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":233,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":234,"name":"potentialTarget","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":231,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":232,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":233,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"void"},{"type":"reflection","declaration":{"id":235,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"invokers.ts","line":23,"character":11,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L23"}],"signatures":[{"id":236,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":237,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":231,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":232,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":233,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"void"}}]}}]}}]},{"id":220,"name":"invoker","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"invokers.ts","line":9,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L9"}],"signatures":[{"id":221,"name":"invoker","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies a custom Invoker for the decorated item."}]},"sources":[{"fileName":"invokers.ts","line":9,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L9"}],"typeParameters":[{"id":222,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":223,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":224,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":225,"name":"value","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":238,"typeArguments":[{"type":"reference","target":222,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":223,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":224,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Invoker","package":"aurelia-dependency-injection"}}],"type":{"type":"reflection","declaration":{"id":226,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"invokers.ts","line":11,"character":3,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/invokers.ts#L11"}],"signatures":[{"id":227,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":228,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":222,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":223,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":224,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":352,"name":"lazy","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":531,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L531"}],"signatures":[{"id":353,"name":"lazy","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency should be lazy loaded"}]},"sources":[{"fileName":"resolvers.ts","line":531,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L531"}],"typeParameters":[{"id":354,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":355,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":354,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":356,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":354,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":357,"name":"keyValue","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reflection","declaration":{"id":358,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":537,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L537"}],"signatures":[{"id":359,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":537,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L537"}],"parameters":[{"id":360,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reflection","declaration":{"id":361,"name":"__type","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":538,"character":12,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L538"}],"signatures":[{"id":362,"name":"new target","variant":"signature","kind":16384,"flags":{},"sources":[{"fileName":"resolvers.ts","line":538,"character":14,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L538"}],"parameters":[{"id":363,"name":"args","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"reference","target":356,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"union","types":[{"type":"reference","target":354,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":355,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true}]}}]}}},{"id":364,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":365,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":415,"name":"newInstance","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":629,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L629"}],"signatures":[{"id":416,"name":"newInstance","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency as a new instance. Instances can optionally be registered in the container\r\nunder a different key and/or use dynamic dependencies"}]},"sources":[{"fileName":"resolvers.ts","line":629,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L629"}],"typeParameters":[{"id":417,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":418,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":417,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":419,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":417,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":420,"name":"asKeyOrTarget","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"unknown","name":"PrimitiveOrDependencyCtor & { inject?: TArgs[number][] | undefined; }"}},{"id":421,"name":"dynamicDependencies","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":419,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"type":{"type":"reflection","declaration":{"id":422,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":638,"character":11,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L638"}],"signatures":[{"id":423,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":638,"character":11,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L638"}],"parameters":[{"id":424,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reflection","declaration":{"id":425,"name":"__type","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"resolvers.ts","line":639,"character":14,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L639"}],"signatures":[{"id":426,"name":"new target","variant":"signature","kind":16384,"flags":{},"sources":[{"fileName":"resolvers.ts","line":639,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L639"}],"parameters":[{"id":427,"name":"args","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"any"}}]}}},{"id":428,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":429,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":379,"name":"optional","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":570,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L570"}],"signatures":[{"id":380,"name":"optional","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency as optional"}]},"sources":[{"fileName":"resolvers.ts","line":570,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L570"}],"typeParameters":[{"id":381,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":382,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":381,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":383,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":381,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":384,"name":"checkParentOrTarget","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"true"}],"type":{"type":"reflection","declaration":{"id":385,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":576,"character":11,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L576"}],"signatures":[{"id":386,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":576,"character":11,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L576"}],"parameters":[{"id":387,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":381,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":382,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":383,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":388,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":389,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":577,"character":54,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L577"}],"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":383,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"groups":[{"title":"Properties","children":[389]}],"sources":[{"fileName":"resolvers.ts","line":577,"character":52,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L577"}]}}]}},{"id":390,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":391,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":392,"name":"parent","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"resolvers.ts","line":594,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L594"}],"signatures":[{"id":393,"name":"parent","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies the dependency to look at the parent container for\r\nresolution"}]},"sources":[{"fileName":"resolvers.ts","line":594,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L594"}],"typeParameters":[{"id":394,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":395,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Impl"},"typeArguments":[{"type":"reference","target":394,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Impl","package":"aurelia-dependency-injection"}},{"id":396,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]},"default":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"Args"},"typeArguments":[{"type":"reference","target":394,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Args","package":"aurelia-dependency-injection"}}],"parameters":[{"id":397,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"intersection","types":[{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":394,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":395,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":396,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"},{"type":"reflection","declaration":{"id":398,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":399,"name":"inject","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":598,"character":52,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L598"}],"type":{"type":"array","elementType":{"type":"indexedAccess","indexType":{"type":"intrinsic","name":"number"},"objectType":{"type":"reference","target":396,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}}}}],"groups":[{"title":"Properties","children":[399]}],"sources":[{"fileName":"resolvers.ts","line":598,"character":50,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L598"}]}}]}},{"id":400,"name":"_key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}},{"id":401,"name":"index","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":274,"name":"registration","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"registrations.ts","line":17,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L17"}],"signatures":[{"id":275,"name":"registration","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies a custom registration strategy for the decorated\r\nclass/function."}]},"sources":[{"fileName":"registrations.ts","line":17,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L17"}],"typeParameters":[{"id":276,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":277,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":278,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":279,"name":"value","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":301,"typeArguments":[{"type":"reference","target":276,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":277,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":278,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"Registration","package":"aurelia-dependency-injection"}}],"type":{"type":"reflection","declaration":{"id":280,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"registrations.ts","line":19,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L19"}],"signatures":[{"id":281,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"registrations.ts","line":19,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L19"}],"parameters":[{"id":282,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":276,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":277,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":278,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]},{"id":1,"name":"resolve","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"container.ts","line":643,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L643"},{"fileName":"container.ts","line":644,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L644"},{"fileName":"container.ts","line":645,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L645"}],"signatures":[{"id":2,"name":"resolve","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Resolve a key, or list of keys based on the current container."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```ts\r\nimport { resolve } from 'aurelia-framework';\r\n// or\r\n// import { Container, resolve } from 'aurelia-dependency-injection';\r\n\r\nclass MyCustomElement {\r\n someService = resolve(MyService);\r\n}\r\n```"}]}]},"sources":[{"fileName":"container.ts","line":643,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L643"}],"typeParameters":[{"id":3,"name":"K","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}}],"parameters":[{"id":4,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":3,"name":"K","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"reference","target":192,"typeArguments":[{"type":"reference","target":3,"name":"K","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ResolvedValue","package":"aurelia-dependency-injection"}},{"id":5,"name":"resolve","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"container.ts","line":644,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/container.ts#L644"}],"typeParameters":[{"id":6,"name":"K","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"parameters":[{"id":7,"name":"keys","variant":"param","kind":32768,"flags":{"isRest":true},"type":{"type":"reference","target":6,"name":"K","package":"aurelia-dependency-injection","refersToTypeParameter":true}}],"type":{"type":"reference","target":192,"typeArguments":[{"type":"reference","target":6,"name":"K","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"ResolvedValue","package":"aurelia-dependency-injection"}}]},{"id":430,"name":"resolver","variant":"declaration","kind":64,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Indicates that the decorated class/object is a custom resolver."}]},"children":[{"id":432,"name":"decorates","variant":"declaration","kind":1024,"flags":{"isOptional":true},"sources":[{"fileName":"resolvers.ts","line":19,"character":2,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}],"type":{"type":"reflection","declaration":{"id":433,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"resolvers.ts","line":19,"character":14,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}],"signatures":[{"id":434,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":19,"character":14,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}],"parameters":[{"id":435,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"predicate","name":"key","asserts":false,"targetType":{"type":"reflection","declaration":{"id":436,"name":"__type","variant":"declaration","kind":65536,"flags":{},"children":[{"id":437,"name":"get","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"resolvers.ts","line":19,"character":37,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}],"signatures":[{"id":438,"name":"get","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":19,"character":37,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}],"parameters":[{"id":439,"name":"container","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":34,"name":"Container","package":"aurelia-dependency-injection"}},{"id":440,"name":"key","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}]}],"groups":[{"title":"Methods","children":[437]}],"sources":[{"fileName":"resolvers.ts","line":19,"character":35,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L19"}]}}}}]}}}],"groups":[{"title":"Properties","children":[432]}],"sources":[{"fileName":"resolvers.ts","line":18,"character":13,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L18"}],"signatures":[{"id":431,"name":"resolver","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"resolvers.ts","line":20,"character":5,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/resolvers.ts#L20"}],"type":{"type":"intrinsic","name":"any"}}]},{"id":292,"name":"singleton","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"registrations.ts","line":37,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L37"},{"fileName":"registrations.ts","line":38,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L38"},{"fileName":"registrations.ts","line":40,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L40"}],"signatures":[{"id":293,"name":"singleton","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies to register the decorated item with a \"singleton\"\r\nlifetime."}]},"sources":[{"fileName":"registrations.ts","line":37,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L37"}],"parameters":[{"id":294,"name":"registerInChild","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"intrinsic","name":"any"}},{"id":295,"name":"singleton","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"registrations.ts","line":38,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L38"}],"typeParameters":[{"id":296,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":297,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":298,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":299,"name":"key","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":296,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":297,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":298,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}},{"id":300,"name":"registerInChild","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"intrinsic","name":"any"}}]},{"id":283,"name":"transient","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"registrations.ts","line":28,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L28"}],"signatures":[{"id":284,"name":"transient","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Decorator: Specifies to register the decorated item with a \"transient\"\r\nlifetime."}]},"sources":[{"fileName":"registrations.ts","line":28,"character":16,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L28"}],"typeParameters":[{"id":285,"name":"TBase","variant":"typeParam","kind":131072,"flags":{}},{"id":286,"name":"TImpl","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"intrinsic","name":"unknown"}},{"id":287,"name":"TArgs","variant":"typeParam","kind":131072,"flags":{},"type":{"type":"union","types":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}},{"type":"array","elementType":{"type":"intrinsic","name":"unknown"}}]}}],"parameters":[{"id":288,"name":"key","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"PrimitiveOrDependencyCtor"},"typeArguments":[{"type":"reference","target":285,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":286,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":287,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"PrimitiveOrDependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"reflection","declaration":{"id":289,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"registrations.ts","line":19,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L19"}],"signatures":[{"id":290,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"registrations.ts","line":19,"character":9,"url":"https://github.com/aurelia/dependency-injection/blob/ccac164c511274a5b37db441cdfea924c92b37fd/src/registrations.ts#L19"}],"parameters":[{"id":291,"name":"target","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"src/types.d.ts","qualifiedName":"DependencyCtor"},"typeArguments":[{"type":"reference","target":285,"name":"TBase","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":286,"name":"TImpl","package":"aurelia-dependency-injection","refersToTypeParameter":true},{"type":"reference","target":287,"name":"TArgs","package":"aurelia-dependency-injection","refersToTypeParameter":true}],"name":"DependencyCtor","package":"aurelia-dependency-injection"}}],"type":{"type":"intrinsic","name":"void"}}]}}}]}],"groups":[{"title":"Enumerations","children":[446]},{"title":"Classes","children":[521,34,587,253,9,498,608,542,566,326,479,310]},{"title":"Interfaces","children":[28,238,301,441,463]},{"title":"Type Aliases","children":[453,215,192,454]},{"title":"Functions","children":[366,202,402,344,209,229,220,352,415,379,392,274,1,430,292,283]}],"packageName":"aurelia-dependency-injection","readme":[{"kind":"text","text":"

\n \n \"Aurelia\"\n \n

\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![npm Version](https://img.shields.io/npm/v/aurelia-dependency-injection.svg)](https://www.npmjs.com/package/aurelia-dependency-injection)\n![ci](https://github.com/aurelia/dependency-injection/actions/workflows/main.yml/badge.svg)\n[![Discourse status](https://img.shields.io/discourse/https/meta.discourse.org/status.svg)](https://discourse.aurelia.io)\n[![Twitter](https://img.shields.io/twitter/follow/aureliaeffect.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=aureliaeffect)\n[![Discord Chat](https://img.shields.io/discord/448698263508615178.svg)](https://discord.gg/RBtyM6u)\n\n# aurelia-dependency-injection\n\nThis library is part of the [Aurelia](http://www.aurelia.io/) platform and contains a lightweight, extensible dependency injection container for JavaScript.\n\n## Documentation\n\nYou can read documentation on dependency injection [here](https://aurelia.io/docs/fundamentals/dependency-injection/). If you would like to help improve this documentation, the source for the above can be found in the doc folder within this repository.\n\n## Platform Support\n\nThis library can be used in the **browser** as well as on the **server**.\n\n## Reporting Issues\n\nPlease refer to the [issue template]("},{"kind":"relative-link","text":"ISSUE_TEMPLATE.md","target":2},{"kind":"text","text":"). Accompany any bug report with a demo of the issue using a [runnable Gist](https://gist.run/?id=381fdb1a4b0865a4c25026187db865ce).\n\n## Building\n\n"},{"kind":"code","text":"```shell\nnpm run build\n```"},{"kind":"text","text":"\n\n## Tests\n\n"},{"kind":"code","text":"```shell\nnpm run test\n```"},{"kind":"text","text":"\n\n## Developing\n\nRun the tests in watch mode:\n\n"},{"kind":"code","text":"```shell\nnpm run develop\n```"},{"kind":"text","text":"\n\n## Publishing\n\n1. Bump the version\n \n "},{"kind":"code","text":"```shell\n npm run bump-version [ | major | minor | patch]\n ```"},{"kind":"text","text":"\n\n2. Prepare the release (run tests, run build, docs, release notes)\n \n "},{"kind":"code","text":"```shell\n npm run prepare-release\n ```"},{"kind":"text","text":"\n\n3. Commit, tag, npm publish (not automated)"}],"symbolIdMap":{"0":{"sourceFileName":"src/aurelia-dependency-injection.ts","qualifiedName":""},"1":{"sourceFileName":"src/container.ts","qualifiedName":"resolve"},"2":{"sourceFileName":"src/container.ts","qualifiedName":"resolve"},"3":{"sourceFileName":"src/container.ts","qualifiedName":"K"},"4":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"5":{"sourceFileName":"src/container.ts","qualifiedName":"resolve"},"6":{"sourceFileName":"src/container.ts","qualifiedName":"K"},"7":{"sourceFileName":"src/container.ts","qualifiedName":"keys"},"9":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler"},"10":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.__constructor"},"11":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler"},"12":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TBase"},"13":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TImpl"},"14":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TArgs"},"15":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"16":{"sourceFileName":"src/container.ts","qualifiedName":"invoker"},"17":{"sourceFileName":"src/container.ts","qualifiedName":"dependencies"},"18":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.fn"},"19":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.invoker"},"20":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.dependencies"},"21":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.invoke"},"22":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.invoke"},"23":{"sourceFileName":"src/container.ts","qualifiedName":"container"},"24":{"sourceFileName":"src/container.ts","qualifiedName":"dynamicDependencies"},"25":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TBase"},"26":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TImpl"},"27":{"sourceFileName":"src/container.ts","qualifiedName":"InvocationHandler.TArgs"},"28":{"sourceFileName":"src/container.ts","qualifiedName":"ContainerConfiguration"},"29":{"sourceFileName":"src/container.ts","qualifiedName":"ContainerConfiguration.onHandlerCreated"},"30":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"31":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"32":{"sourceFileName":"src/container.ts","qualifiedName":"handler"},"33":{"sourceFileName":"src/container.ts","qualifiedName":"ContainerConfiguration.handlers"},"34":{"sourceFileName":"src/container.ts","qualifiedName":"Container"},"35":{"sourceFileName":"src/container.ts","qualifiedName":"Container.instance"},"36":{"sourceFileName":"src/container.ts","qualifiedName":"Container.__constructor"},"37":{"sourceFileName":"src/container.ts","qualifiedName":"Container"},"38":{"sourceFileName":"src/container.ts","qualifiedName":"configuration"},"39":{"sourceFileName":"src/container.ts","qualifiedName":"Container.parent"},"40":{"sourceFileName":"src/container.ts","qualifiedName":"Container.root"},"48":{"sourceFileName":"src/container.ts","qualifiedName":"Container.makeGlobal"},"49":{"sourceFileName":"src/container.ts","qualifiedName":"Container.makeGlobal"},"50":{"sourceFileName":"src/container.ts","qualifiedName":"Container.setHandlerCreatedCallback"},"51":{"sourceFileName":"src/container.ts","qualifiedName":"Container.setHandlerCreatedCallback"},"52":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"53":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"54":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"55":{"sourceFileName":"src/container.ts","qualifiedName":"onHandlerCreated"},"56":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"57":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"58":{"sourceFileName":"src/container.ts","qualifiedName":"handler"},"59":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerInstance"},"60":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerInstance"},"61":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"62":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"63":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"64":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"65":{"sourceFileName":"src/container.ts","qualifiedName":"instance"},"66":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerSingleton"},"67":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerSingleton"},"68":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"69":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"70":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"71":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"72":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"73":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerSingleton"},"74":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"75":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"76":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"77":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"78":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"79":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerTransient"},"80":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerTransient"},"81":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"82":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"83":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"84":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"85":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"86":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerTransient"},"87":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"88":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"89":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"90":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"91":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"92":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerHandler"},"93":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerHandler"},"94":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"95":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"96":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"97":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"98":{"sourceFileName":"src/container.ts","qualifiedName":"handler"},"99":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"100":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"101":{"sourceFileName":"src/container.ts","qualifiedName":"container"},"102":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"103":{"sourceFileName":"src/container.ts","qualifiedName":"resolver"},"104":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerAlias"},"105":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerAlias"},"106":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"107":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"108":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"109":{"sourceFileName":"src/container.ts","qualifiedName":"originalKey"},"110":{"sourceFileName":"src/container.ts","qualifiedName":"aliasKey"},"111":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerResolver"},"112":{"sourceFileName":"src/container.ts","qualifiedName":"Container.registerResolver"},"113":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"114":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"115":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"116":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"117":{"sourceFileName":"src/container.ts","qualifiedName":"resolver"},"118":{"sourceFileName":"src/container.ts","qualifiedName":"Container.autoRegister"},"119":{"sourceFileName":"src/container.ts","qualifiedName":"Container.autoRegister"},"120":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"121":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"122":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"123":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"124":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"125":{"sourceFileName":"src/container.ts","qualifiedName":"Container.autoRegister"},"126":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"127":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"128":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"129":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"130":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"131":{"sourceFileName":"src/container.ts","qualifiedName":"Container.autoRegisterAll"},"132":{"sourceFileName":"src/container.ts","qualifiedName":"Container.autoRegisterAll"},"133":{"sourceFileName":"src/container.ts","qualifiedName":"fns"},"134":{"sourceFileName":"src/container.ts","qualifiedName":"Container.unregister"},"135":{"sourceFileName":"src/container.ts","qualifiedName":"Container.unregister"},"136":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"137":{"sourceFileName":"src/container.ts","qualifiedName":"Container.hasResolver"},"138":{"sourceFileName":"src/container.ts","qualifiedName":"Container.hasResolver"},"139":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"140":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"141":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"142":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"143":{"sourceFileName":"src/container.ts","qualifiedName":"checkParent"},"144":{"sourceFileName":"src/container.ts","qualifiedName":"Container.getResolver"},"145":{"sourceFileName":"src/container.ts","qualifiedName":"Container.getResolver"},"146":{"sourceFileName":"src/container.ts","qualifiedName":"TStrategyKey"},"147":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"148":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"149":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"150":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"151":{"sourceFileName":"src/container.ts","qualifiedName":"Container.get"},"152":{"sourceFileName":"src/container.ts","qualifiedName":"Container.get"},"153":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"154":{"sourceFileName":"src/container.ts","qualifiedName":"TResolver"},"155":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"156":{"sourceFileName":"src/container.ts","qualifiedName":"Container.get"},"157":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"158":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"159":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"160":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"161":{"sourceFileName":"src/container.ts","qualifiedName":"Container.get"},"162":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"163":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"164":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"165":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"166":{"sourceFileName":"src/container.ts","qualifiedName":"Container._get"},"167":{"sourceFileName":"src/container.ts","qualifiedName":"Container._get"},"168":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"169":{"sourceFileName":"src/container.ts","qualifiedName":"Container.getAll"},"170":{"sourceFileName":"src/container.ts","qualifiedName":"Container.getAll"},"171":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"172":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"173":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"174":{"sourceFileName":"src/container.ts","qualifiedName":"key"},"175":{"sourceFileName":"src/container.ts","qualifiedName":"Container.createChild"},"176":{"sourceFileName":"src/container.ts","qualifiedName":"Container.createChild"},"177":{"sourceFileName":"src/container.ts","qualifiedName":"Container.invoke"},"178":{"sourceFileName":"src/container.ts","qualifiedName":"Container.invoke"},"179":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"180":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"181":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"182":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"183":{"sourceFileName":"src/container.ts","qualifiedName":"dynamicDependencies"},"184":{"sourceFileName":"src/container.ts","qualifiedName":"Container._createInvocationHandler"},"185":{"sourceFileName":"src/container.ts","qualifiedName":"Container._createInvocationHandler"},"186":{"sourceFileName":"src/container.ts","qualifiedName":"TBase"},"187":{"sourceFileName":"src/container.ts","qualifiedName":"TImpl"},"188":{"sourceFileName":"src/container.ts","qualifiedName":"TArgs"},"189":{"sourceFileName":"src/container.ts","qualifiedName":"fn"},"190":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"191":{"sourceFileName":"src/container.ts","qualifiedName":"__type.inject"},"192":{"sourceFileName":"src/container.ts","qualifiedName":"ResolvedValue"},"193":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"194":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"195":{"sourceFileName":"src/container.ts","qualifiedName":"args"},"196":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"197":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"198":{"sourceFileName":"src/container.ts","qualifiedName":"args"},"199":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"200":{"sourceFileName":"src/container.ts","qualifiedName":"__type"},"201":{"sourceFileName":"src/container.ts","qualifiedName":"T"},"202":{"sourceFileName":"src/injection.ts","qualifiedName":"autoinject"},"203":{"sourceFileName":"src/injection.ts","qualifiedName":"autoinject"},"204":{"sourceFileName":"src/injection.ts","qualifiedName":"TPotential"},"205":{"sourceFileName":"src/injection.ts","qualifiedName":"potentialTarget"},"206":{"sourceFileName":"src/injection.ts","qualifiedName":"__type"},"207":{"sourceFileName":"src/injection.ts","qualifiedName":"__type"},"208":{"sourceFileName":"src/injection.ts","qualifiedName":"target"},"209":{"sourceFileName":"src/injection.ts","qualifiedName":"inject"},"210":{"sourceFileName":"src/injection.ts","qualifiedName":"inject"},"211":{"sourceFileName":"src/injection.ts","qualifiedName":"TBase"},"212":{"sourceFileName":"src/injection.ts","qualifiedName":"TImpl"},"213":{"sourceFileName":"src/injection.ts","qualifiedName":"TArgs"},"214":{"sourceFileName":"src/injection.ts","qualifiedName":"rest"},"215":{"sourceFileName":"src/injection.ts","qualifiedName":"Injectable"},"216":{"sourceFileName":"src/injection.ts","qualifiedName":"__type"},"217":{"sourceFileName":"src/injection.ts","qualifiedName":"__type.inject"},"218":{"sourceFileName":"src/injection.ts","qualifiedName":"__type"},"219":{"sourceFileName":"src/injection.ts","qualifiedName":"__type"},"220":{"sourceFileName":"src/invokers.ts","qualifiedName":"invoker"},"221":{"sourceFileName":"src/invokers.ts","qualifiedName":"invoker"},"222":{"sourceFileName":"src/invokers.ts","qualifiedName":"TBase"},"223":{"sourceFileName":"src/invokers.ts","qualifiedName":"TImpl"},"224":{"sourceFileName":"src/invokers.ts","qualifiedName":"TArgs"},"225":{"sourceFileName":"src/invokers.ts","qualifiedName":"value"},"226":{"sourceFileName":"src/invokers.ts","qualifiedName":"__type"},"227":{"sourceFileName":"src/invokers.ts","qualifiedName":"__type"},"228":{"sourceFileName":"src/invokers.ts","qualifiedName":"target"},"229":{"sourceFileName":"src/invokers.ts","qualifiedName":"invokeAsFactory"},"230":{"sourceFileName":"src/invokers.ts","qualifiedName":"invokeAsFactory"},"231":{"sourceFileName":"src/invokers.ts","qualifiedName":"TBase"},"232":{"sourceFileName":"src/invokers.ts","qualifiedName":"TImpl"},"233":{"sourceFileName":"src/invokers.ts","qualifiedName":"TArgs"},"234":{"sourceFileName":"src/invokers.ts","qualifiedName":"potentialTarget"},"235":{"sourceFileName":"src/invokers.ts","qualifiedName":"__type"},"236":{"sourceFileName":"src/invokers.ts","qualifiedName":"__type"},"237":{"sourceFileName":"src/invokers.ts","qualifiedName":"target"},"238":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker"},"239":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.invoke"},"240":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.invoke"},"241":{"sourceFileName":"src/invokers.ts","qualifiedName":"container"},"242":{"sourceFileName":"src/invokers.ts","qualifiedName":"fn"},"243":{"sourceFileName":"src/invokers.ts","qualifiedName":"dependencies"},"244":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.invokeWithDynamicDependencies"},"245":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.invokeWithDynamicDependencies"},"246":{"sourceFileName":"src/invokers.ts","qualifiedName":"container"},"247":{"sourceFileName":"src/invokers.ts","qualifiedName":"fn"},"248":{"sourceFileName":"src/invokers.ts","qualifiedName":"staticDependencies"},"249":{"sourceFileName":"src/invokers.ts","qualifiedName":"dynamicDependencies"},"250":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.TBase"},"251":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.TImpl"},"252":{"sourceFileName":"src/invokers.ts","qualifiedName":"Invoker.TArgs"},"253":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker"},"254":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.instance"},"257":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TBase"},"258":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TImpl"},"259":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TArgs"},"260":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.invoke"},"261":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.invoke"},"262":{"sourceFileName":"src/invokers.ts","qualifiedName":"container"},"263":{"sourceFileName":"src/invokers.ts","qualifiedName":"fn"},"264":{"sourceFileName":"src/invokers.ts","qualifiedName":"dependencies"},"265":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.invokeWithDynamicDependencies"},"266":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.invokeWithDynamicDependencies"},"267":{"sourceFileName":"src/invokers.ts","qualifiedName":"container"},"268":{"sourceFileName":"src/invokers.ts","qualifiedName":"fn"},"269":{"sourceFileName":"src/invokers.ts","qualifiedName":"staticDependencies"},"270":{"sourceFileName":"src/invokers.ts","qualifiedName":"dynamicDependencies"},"271":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TBase"},"272":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TImpl"},"273":{"sourceFileName":"src/invokers.ts","qualifiedName":"FactoryInvoker.TArgs"},"274":{"sourceFileName":"src/registrations.ts","qualifiedName":"registration"},"275":{"sourceFileName":"src/registrations.ts","qualifiedName":"registration"},"276":{"sourceFileName":"src/registrations.ts","qualifiedName":"TBase"},"277":{"sourceFileName":"src/registrations.ts","qualifiedName":"TImpl"},"278":{"sourceFileName":"src/registrations.ts","qualifiedName":"TArgs"},"279":{"sourceFileName":"src/registrations.ts","qualifiedName":"value"},"280":{"sourceFileName":"src/registrations.ts","qualifiedName":"__function"},"281":{"sourceFileName":"src/registrations.ts","qualifiedName":"__function"},"282":{"sourceFileName":"src/registrations.ts","qualifiedName":"target"},"283":{"sourceFileName":"src/registrations.ts","qualifiedName":"transient"},"284":{"sourceFileName":"src/registrations.ts","qualifiedName":"transient"},"285":{"sourceFileName":"src/registrations.ts","qualifiedName":"TBase"},"286":{"sourceFileName":"src/registrations.ts","qualifiedName":"TImpl"},"287":{"sourceFileName":"src/registrations.ts","qualifiedName":"TArgs"},"288":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"289":{"sourceFileName":"src/registrations.ts","qualifiedName":"__function"},"290":{"sourceFileName":"src/registrations.ts","qualifiedName":"__function"},"291":{"sourceFileName":"src/registrations.ts","qualifiedName":"target"},"292":{"sourceFileName":"src/registrations.ts","qualifiedName":"singleton"},"293":{"sourceFileName":"src/registrations.ts","qualifiedName":"singleton"},"294":{"sourceFileName":"src/registrations.ts","qualifiedName":"registerInChild"},"295":{"sourceFileName":"src/registrations.ts","qualifiedName":"singleton"},"296":{"sourceFileName":"src/registrations.ts","qualifiedName":"TBase"},"297":{"sourceFileName":"src/registrations.ts","qualifiedName":"TImpl"},"298":{"sourceFileName":"src/registrations.ts","qualifiedName":"TArgs"},"299":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"300":{"sourceFileName":"src/registrations.ts","qualifiedName":"registerInChild"},"301":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration"},"302":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration.registerResolver"},"303":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration.registerResolver"},"304":{"sourceFileName":"src/registrations.ts","qualifiedName":"container"},"305":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"306":{"sourceFileName":"src/registrations.ts","qualifiedName":"fn"},"307":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration.TBase"},"308":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration.TImpl"},"309":{"sourceFileName":"src/registrations.ts","qualifiedName":"Registration.TArgs"},"310":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration"},"311":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.__constructor"},"312":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration"},"313":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TBase"},"314":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TImpl"},"315":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TArgs"},"316":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"318":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.registerResolver"},"319":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.registerResolver"},"320":{"sourceFileName":"src/registrations.ts","qualifiedName":"container"},"321":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"322":{"sourceFileName":"src/registrations.ts","qualifiedName":"fn"},"323":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TBase"},"324":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TImpl"},"325":{"sourceFileName":"src/registrations.ts","qualifiedName":"TransientRegistration.TArgs"},"326":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration"},"327":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.__constructor"},"328":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration"},"329":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TBase"},"330":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TImpl"},"331":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TArgs"},"332":{"sourceFileName":"src/registrations.ts","qualifiedName":"keyOrRegisterInChild"},"333":{"sourceFileName":"src/registrations.ts","qualifiedName":"registerInChild"},"336":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.registerResolver"},"337":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.registerResolver"},"338":{"sourceFileName":"src/registrations.ts","qualifiedName":"container"},"339":{"sourceFileName":"src/registrations.ts","qualifiedName":"key"},"340":{"sourceFileName":"src/registrations.ts","qualifiedName":"fn"},"341":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TBase"},"342":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TImpl"},"343":{"sourceFileName":"src/registrations.ts","qualifiedName":"SingletonRegistration.TArgs"},"344":{"sourceFileName":"src/resolvers.ts","qualifiedName":"getDecoratorDependencies"},"345":{"sourceFileName":"src/resolvers.ts","qualifiedName":"getDecoratorDependencies"},"346":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"347":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"348":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"349":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"350":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"351":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.inject"},"352":{"sourceFileName":"src/resolvers.ts","qualifiedName":"lazy"},"353":{"sourceFileName":"src/resolvers.ts","qualifiedName":"lazy"},"354":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"355":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"356":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"357":{"sourceFileName":"src/resolvers.ts","qualifiedName":"keyValue"},"358":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"359":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"360":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"361":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"362":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"363":{"sourceFileName":"src/resolvers.ts","qualifiedName":"args"},"364":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"365":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"366":{"sourceFileName":"src/resolvers.ts","qualifiedName":"all"},"367":{"sourceFileName":"src/resolvers.ts","qualifiedName":"all"},"368":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"369":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"370":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"371":{"sourceFileName":"src/resolvers.ts","qualifiedName":"keyValue"},"372":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"373":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"374":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"375":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"376":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.inject"},"377":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"378":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"379":{"sourceFileName":"src/resolvers.ts","qualifiedName":"optional"},"380":{"sourceFileName":"src/resolvers.ts","qualifiedName":"optional"},"381":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"382":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"383":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"384":{"sourceFileName":"src/resolvers.ts","qualifiedName":"checkParentOrTarget"},"385":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"386":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"387":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"388":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"389":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.inject"},"390":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"391":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"392":{"sourceFileName":"src/resolvers.ts","qualifiedName":"parent"},"393":{"sourceFileName":"src/resolvers.ts","qualifiedName":"parent"},"394":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"395":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"396":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"397":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"398":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"399":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.inject"},"400":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"401":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"402":{"sourceFileName":"src/resolvers.ts","qualifiedName":"factory"},"403":{"sourceFileName":"src/resolvers.ts","qualifiedName":"factory"},"404":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"405":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"406":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"407":{"sourceFileName":"src/resolvers.ts","qualifiedName":"keyValue"},"408":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"409":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"410":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"411":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"412":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.inject"},"413":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"414":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"415":{"sourceFileName":"src/resolvers.ts","qualifiedName":"newInstance"},"416":{"sourceFileName":"src/resolvers.ts","qualifiedName":"newInstance"},"417":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"418":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"419":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"420":{"sourceFileName":"src/resolvers.ts","qualifiedName":"asKeyOrTarget"},"421":{"sourceFileName":"src/resolvers.ts","qualifiedName":"dynamicDependencies"},"422":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"423":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__function"},"424":{"sourceFileName":"src/resolvers.ts","qualifiedName":"target"},"425":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"426":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"427":{"sourceFileName":"src/resolvers.ts","qualifiedName":"args"},"428":{"sourceFileName":"src/resolvers.ts","qualifiedName":"_key"},"429":{"sourceFileName":"src/resolvers.ts","qualifiedName":"index"},"430":{"sourceFileName":"src/resolvers.ts","qualifiedName":"resolver"},"431":{"sourceFileName":"src/resolvers.ts","qualifiedName":"resolver"},"432":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.decorates"},"433":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"434":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"435":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"436":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"437":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.get"},"438":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.get"},"439":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"440":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"441":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Resolver"},"442":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Resolver.get"},"443":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Resolver.get"},"444":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"445":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"446":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy"},"447":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.instance"},"448":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.singleton"},"449":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.transient"},"450":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.function"},"451":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.array"},"452":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Strategy.alias"},"453":{"sourceFileName":"src/resolvers.ts","qualifiedName":"IStrategy"},"454":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyFunctor"},"455":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"456":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"457":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"458":{"sourceFileName":"src/resolvers.ts","qualifiedName":"ctor"},"459":{"sourceFileName":"src/resolvers.ts","qualifiedName":"strategyResolver"},"460":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"461":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"462":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"463":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState"},"464":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.0"},"465":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.1"},"466":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.2"},"467":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.3"},"468":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.4"},"469":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"470":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type.get"},"471":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"472":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"473":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"474":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"475":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.5"},"476":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.TBase"},"477":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.TImpl"},"478":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyState.TArgs"},"479":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver"},"480":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.__constructor"},"481":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver"},"482":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TBase"},"483":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TImpl"},"484":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TArgs"},"485":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TStrategyKey"},"486":{"sourceFileName":"src/resolvers.ts","qualifiedName":"strategy"},"487":{"sourceFileName":"src/resolvers.ts","qualifiedName":"state"},"488":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.strategy"},"489":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.state"},"490":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.get"},"491":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.get"},"492":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"493":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"494":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TBase"},"495":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TImpl"},"496":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TArgs"},"497":{"sourceFileName":"src/resolvers.ts","qualifiedName":"StrategyResolver.TStrategyKey"},"498":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy"},"499":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.of"},"500":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.of"},"501":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"502":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"503":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"504":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"505":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.__constructor"},"506":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy"},"507":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TBase"},"508":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TImpl"},"509":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TArgs"},"510":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"512":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.__resolver_type__"},"513":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.get"},"514":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.get"},"515":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"516":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"517":{"sourceFileName":"src/resolvers.ts","qualifiedName":"__type"},"518":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TBase"},"519":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TImpl"},"520":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Lazy.TArgs"},"521":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All"},"522":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.of"},"523":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.of"},"524":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"525":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"526":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"527":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"528":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.__constructor"},"529":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All"},"530":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TBase"},"531":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TImpl"},"532":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TArgs"},"533":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"535":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.__resolver_type__"},"536":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.get"},"537":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.get"},"538":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"539":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TBase"},"540":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TImpl"},"541":{"sourceFileName":"src/resolvers.ts","qualifiedName":"All.TArgs"},"542":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional"},"543":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.of"},"544":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.of"},"545":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"546":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"547":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"548":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"549":{"sourceFileName":"src/resolvers.ts","qualifiedName":"checkParent"},"550":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.__constructor"},"551":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional"},"552":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TBase"},"553":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TImpl"},"554":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TArgs"},"555":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"556":{"sourceFileName":"src/resolvers.ts","qualifiedName":"checkParent"},"559":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.__resolver_type__"},"560":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.get"},"561":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.get"},"562":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"563":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TBase"},"564":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TImpl"},"565":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Optional.TArgs"},"566":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent"},"567":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.of"},"568":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.of"},"569":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"570":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"571":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"572":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"573":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.__constructor"},"574":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent"},"575":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TBase"},"576":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TImpl"},"577":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TArgs"},"578":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"580":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.__resolver_type__"},"581":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.get"},"582":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.get"},"583":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"584":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TBase"},"585":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TImpl"},"586":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Parent.TArgs"},"587":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory"},"588":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.of"},"589":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.of"},"590":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"591":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"592":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"593":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"594":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.__constructor"},"595":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory"},"596":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TBase"},"597":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TImpl"},"598":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TArgs"},"599":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"601":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.__resolver_type__"},"602":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.get"},"603":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.get"},"604":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"605":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TBase"},"606":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TImpl"},"607":{"sourceFileName":"src/resolvers.ts","qualifiedName":"Factory.TArgs"},"608":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance"},"609":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.of"},"610":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.of"},"611":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TBase"},"612":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TImpl"},"613":{"sourceFileName":"src/resolvers.ts","qualifiedName":"TArgs"},"614":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"615":{"sourceFileName":"src/resolvers.ts","qualifiedName":"dynamicDependencies"},"616":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.__constructor"},"617":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance"},"618":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TBase"},"619":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TImpl"},"620":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TArgs"},"621":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"622":{"sourceFileName":"src/resolvers.ts","qualifiedName":"dynamicDependencies"},"626":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.__resolver_type__"},"627":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.get"},"628":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.get"},"629":{"sourceFileName":"src/resolvers.ts","qualifiedName":"container"},"630":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.as"},"631":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.as"},"632":{"sourceFileName":"src/resolvers.ts","qualifiedName":"key"},"633":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TBase"},"634":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TImpl"},"635":{"sourceFileName":"src/resolvers.ts","qualifiedName":"NewInstance.TArgs"}},"files":{"entries":{"1":"src/aurelia-dependency-injection.ts","2":"ISSUE_TEMPLATE.md"},"reflections":{"1":0}}} diff --git a/package-lock.json b/package-lock.json index 40db7a3..56f56a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aurelia-dependency-injection", - "version": "1.5.2", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aurelia-dependency-injection", - "version": "1.5.2", + "version": "1.6.0", "license": "MIT", "dependencies": { "aurelia-metadata": "^1.0.0", diff --git a/package.json b/package.json index ee6a21a..98681c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-dependency-injection", - "version": "1.5.2", + "version": "1.6.0", "description": "A lightweight, extensible dependency injection container for JavaScript.", "keywords": [ "aurelia",