import { Type } from '../common/cli-types'; import { Command } from './command-models'; import { ModuleRef } from '../module/module-ref'; import { Injector } from '../dependency-injection/injector'; import { ParameterDefinition } from '../parameters/parameter-models'; import { EvaluatedParameter } from '../parser/parameter-parser'; import { ProviderRef } from '../dependency-injection/provider-refs/provider-ref'; import { GlobalComponentsRegistry } from '../app/global-components-registry'; import { OptionsLink } from '../options/options-link'; /** * Indirect reference to a command class that is responsible for creating an instance of the class and binding the applicable * command paramaters before the command is executed */ export declare class CommandRef extends Injector { /** * Reference to option container applicable to */ options: OptionsLink[]; /** * List of parameter metadata for all properties in the command that have been decorated with `@CliParameter()` */ parameters: ParameterDefinition[]; /** * Reference to the parent injector module */ parent: ModuleRef; /** * Instance of the command class */ private instance; /** * Creates a new instance of the command reference, reading the metadata that is attached to command's contructor. Will not accept * any undecorated command constructors * @param constructorRef Constructor of the command * @param globalProviders Providers within the global dependency injection scope * @param parent Module which exported the command or where the module that declared the command within its metadata * @param registry Reference to the global components registery for registering options */ constructor(constructorRef: Type, globalProviders: ProviderRef[], parent: ModuleRef, registry: GlobalComponentsRegistry); /** * Checks options provided in the command's metadata and registers them in the global components registry * @param options List of classes decorated with `@CliOptions()` * @param registry Reference to the global components registery for registering options */ private processOptions; /** * Creates an instance of the command class, injecting providers and applicable options as well * as binding the parameters to the command instance before returning it. * @param parameters Validated parameters that have been parsed from the raw cli arguments */ resolveWithParameters(parameters: EvaluatedParameter[]): Promise; /** * Attaches parameters which have been parsed user to an instance of the command class * @param instance Instantiated command class * @param parsedParameters Validated parameters that have been parsed from the raw cli arguments */ private bindParameters; }