Availability
The answer to the question “can this be done here?”. When it can, available is true, and there may be a label and a state (on, off or mixed, for a control that switches). When it cannot, available is false and reason says why. Build it with available() and unavailable(reason).
Properties
Section titled “Properties”available
Section titled “available”available: boolean;true when the action can be performed in the current context, and false when it cannot.
by?: string;The id of the plugin or feature that made the action unavailable.
label?
Section titled “label?”label?: string;The text to display for the action, when it differs from the title of the command.
reason?
Section titled “reason?”reason?: string;When the action is not available, the explanation that the person reads.
state?
Section titled “state?”state?: "on" | "off" | "mixed";For a control that switches between two states, whether it is currently on, off, or mixed (on for some of the selected items and off for others).
