UNPKG

eureka-plugins

Version:

Eureka Bridge for adding Plugins

46 lines (45 loc) 1.68 kB
import DependencyResolver from './DependencyResolver'; /** * Injector resolver for plugins that have dependencies */ export default class InjectorResolver { private chainDependencyRef; private onResolve; /** * Constructor * @param onResolve On resolve function (internal) * @param dependencyRef The dependency resolver for chaining */ constructor(onResolve: (resolution: any) => void, dependencyRef: DependencyResolver); /** * Resolve with a package module (that has installed in parent project) * @param packageName package name to require */ withPackage(packageName: string): DependencyResolver; /** * Resolve with a stream file (Buffer) * @param relativeToProcessPath path relative to process execution path */ withFile(relativeToProcessPath: string): DependencyResolver; /** * Resolve with the full path for the file * @param relativeToProcessPath path relative to process execution path */ withFilePath(relativeToProcessPath: string): DependencyResolver; /** * Resolve with the full path for the folder * @param relativeToProcessPath path relative to process execution path */ withPath(relativeToProcessPath: string): DependencyResolver; /** * Resolve with the value of a environment variable * @param envName Environment Variable */ withEnvironmentVariable(envName: string): DependencyResolver; /** * Resolve with passing value * Warning: Use only when the other options can't fulfill the dependency value * @param value Value for the dependency */ withValue<T>(value: T): DependencyResolver; }