Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createObserverLocator(containerOrLifecycle) {
let container;
if (containerOrLifecycle === undefined || !('get' in containerOrLifecycle)) {
container = kernel_1.DI.createContainer();
container.register(runtime_1.ILifecycleRegistration);
}
else {
container = containerOrLifecycle;
}
const dummyLocator = {
handles() {
return false;
}
};
kernel_1.Registration.instance(runtime_1.IDirtyChecker, null).register(container);
kernel_1.Registration.instance(runtime_1.ITargetObserverLocator, dummyLocator).register(container);
kernel_1.Registration.instance(runtime_1.ITargetAccessorLocator, dummyLocator).register(container);
container.register(runtime_1.IObserverLocatorRegistration);
return container.get(runtime_1.IObserverLocator);
}
exports.createObserverLocator = createObserverLocator;
static register(container) {
container.register(kernel_1.Registration.singleton(this, this));
}
addCall(instance, method, ...args) {
register(container) {
container.register(runtime_1.RuntimeConfiguration, AuTextRenderer, kernel_1.Registration.singleton(runtime_1.IDOM, AuDOM), kernel_1.Registration.singleton(runtime_1.IDOMInitializer, AuDOMInitializer), kernel_1.Registration.singleton(runtime_1.IProjectorLocator, AuProjectorLocator), kernel_1.Registration.singleton(runtime_1.ITargetAccessorLocator, AuObserverLocator), kernel_1.Registration.singleton(runtime_1.ITargetObserverLocator, AuObserverLocator), kernel_1.Registration.instance(runtime_1.ITemplateCompiler, {}));
},
createContainer() {
get container() {
if (this._container === void 0) {
this._container = kernel_1.DI.createContainer(this.config);
kernel_1.Registration.instance(runtime_1.IDOM, this.dom).register(this._container);
kernel_1.Registration.instance(HTMLTestContext, this).register(this._container);
this._container.register(this.Scheduler);
this._container.register(debug_1.DebugConfiguration);
}
return this._container;
}
get scheduler() {
register(container) {
const { Type, key, aliases } = this;
kernel_1.Registration.singleton(key, Type).register(container);
kernel_1.Registration.alias(key, Type).register(container);
runtime_1.registerAliases(aliases, exports.BindingCommand, key, container);
}
}
register(container) {
const { Type, key, aliases } = this;
kernel_1.Registration.singleton(key, Type).register(container);
kernel_1.Registration.alias(key, Type).register(container);
runtime_1.registerAliases(aliases, exports.BindingCommand, key, container);
}
}
register(container) {
return this._container = container.register(kernel_1.Registration.instance(exports.IStartTask, this));
}
resolveTask() {
static register(container) {
return kernel_1.Registration.singleton(runtime_1.IDOMInitializer, this).register(container);
}
initialize(config) {
static register(container) {
return kernel_1.Registration.singleton(exports.IObserverLocator, this).register(container);
}
getObserver(flags, obj, propertyName) {
register(container) {
return container.register(kernel_1.Registration.callback(i18n_configuration_options_1.I18nInitOptions, () => options.initOptions), runtime_1.StartTask.with(i18n_1.I18N).beforeBind().call(i18n => i18n.task), kernel_1.Registration.singleton(i18next_wrapper_1.I18nWrapper, i18next_wrapper_1.I18nextWrapper), kernel_1.Registration.singleton(i18n_1.I18N, i18n_1.I18nService), ...renderers, ...translation);
}
};