patchbayUiSemanticsActionByIdentifierCommandDescriptor top-level property

PatchbayCommandDescriptor patchbayUiSemanticsActionByIdentifierCommandDescriptor
final

Implementation

final patchbayUiSemanticsActionByIdentifierCommandDescriptor = _ui(
  'ui.semantics.actionByIdentifier',
  'Resolve a stable Semantics identifier and invoke an allowed action.',
  interactionModel: PatchbayInteractionModel.userLike,
  parameters: <PatchbayParameterDescriptor>[
    _p('identifier', PatchbayParameterType.string, required: true),
    _p('generation', PatchbayParameterType.integer, required: true),
    _p(
      'action',
      PatchbayParameterType.enumeration,
      required: true,
      allowedValues: const <String>[
        'tap',
        'focus',
        'scrollUp',
        'scrollDown',
        'scrollLeft',
        'scrollRight',
        'setText',
      ],
    ),
    _p('text', PatchbayParameterType.string),
    _p('inputWasStdin', PatchbayParameterType.boolean),
  ],
  cliSyntax: const <PatchbayCliSyntax>[
    PatchbayCliSyntax(
      id: 'uiAction',
      path: <String>['ui', 'action'],
      summary: 'Resolve an identifier and dispatch a semantics action.',
      usageSuffix: '<identifier> <generation> <action> [text]',
      positionalParameters: <String>['identifier', 'generation', 'action'],
      nonNegativeParameters: <String>{'generation'},
      trailingParameter: 'text',
      stdinParameter: 'text',
      stdinMarkerParameter: 'inputWasStdin',
      trailingWhen: PatchbayCliEqualsCondition(
        parameter: 'action',
        value: 'setText',
      ),
    ),
  ],
);