Home > @momentum-design/common > Command

Command class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The Abstract Command class to be extended by scoped Command classes.

Signature:

declare abstract class Command<O extends Options, P extends Params> 

Constructors

ConstructorModifiersDescription
(constructor)(options)(BETA) Construct a new Command.

Properties

PropertyModifiersTypeDescription
CONSTANTS

readonly

static

typeof CONSTANTS(BETA) Constants associated with this Command.
optionsO(BETA) Options to use when parsing the provided CLI command
paramsParams(BETA) Params generated in reflection of the provided options and the CLI command.

Methods

MethodModifiersDescription
clean()protected(BETA) Clean the params mounted to this Command.
collect()protected(BETA) Collect all CLI arguments as parameters.
prepare(results)(BETA) Prepare the processed results for emiting as a string.
process()(BETA) Process the Command params into a new object for transport.