UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

64 lines 2.95 kB
import { NgModuleRef, EnvironmentInjector, Type, Injector, InjectionToken, ValueProvider, ClassProvider, ExistingProvider, Provider, StaticProvider, InjectFlags, InjectOptions } from '@angular/core'; import { GenericHookType } from '../common/extension-hooks'; import { RemoteModuleFactoryWithMetadata } from '@c8y/bootstrap'; import { PluginsResolveService } from './plugins-resolve.service'; import * as i0 from "@angular/core"; export interface RemoteModuleWithMetadata { moduleRef?: NgModuleRef<unknown>; remoteNgModule?: NgModuleRef<unknown> | Type<unknown>; injector: EnvironmentInjector | StandalonePluginInjector; name: string; fullContextPath: string; } export declare class StandalonePluginInjector extends Injector { private options; /** * @deprecated Use `constructor` instead. */ static create(..._args: any[]): StandalonePluginInjector; private injector; constructor(options: { providers: Array<Provider | StaticProvider>; parent?: Injector; name?: string; }); get name(): string | undefined; get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T; } /** * @deprecated Only meant for internal usage. * @internal */ export declare const HOOK_PLUGIN: InjectionToken<any>; /** * @deprecated Only meant for internal usage. * @internal */ export declare function hookPlugin(plugins: GenericHookType<any>): ValueProvider | ClassProvider | ExistingProvider; export declare class PluginsLoaderService { private plugins; private injector; private pluginsResolveService; constructor(plugins: Array<RemoteModuleFactoryWithMetadata<string>>, injector: EnvironmentInjector, pluginsResolveService: PluginsResolveService); /** * Loads modules and handles hooking correctly. * @param remoteNgModules The modules to load. */ loadModulesDynamically(remoteModules: Array<RemoteModuleFactoryWithMetadata<string>>): RemoteModuleWithMetadata[]; /** * Uses the provided remoteModule factories to load and instantiate the modules. * The provided injector is used as a parent to create the module instances. */ protected loadModules(remoteModules: Array<RemoteModuleFactoryWithMetadata<string>>, injector: Injector): Array<RemoteModuleWithMetadata>; protected loadProviders(providers: Provider[], name: string, parentInjector: Injector): { injector: StandalonePluginInjector; }; protected loadModule<T = unknown>(remoteNgModule: NgModuleRef<T> | Type<T>, parentInjector: Injector): { moduleRef: NgModuleRef<T>; remoteNgModule: NgModuleRef<T> | Type<T>; injector: EnvironmentInjector; }; static ɵfac: i0.ɵɵFactoryDeclaration<PluginsLoaderService, [{ optional: true; }, null, null]>; static ɵprov: i0.ɵɵInjectableDeclaration<PluginsLoaderService>; } //# sourceMappingURL=plugins-loader.service.d.ts.map