import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Prints a mathematical operator.
 */ export class OperatorCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . Operator ) . withDescription ( "Prints a mathematical operator" ) . withParameters ( [ new SingleParameter ( "operator" , "An operator to alias." , true ) ] ) ; returns public getMetadata ( ) { return OperatorCommand . metadata ; } param parameters returns public render ( parameters ) { return LineResults . newSingleLine ( this . convertOperator ( parameters [ 1 ] ) ) ; } param typeNameRaw returns private convertOperator ( operatorRaw ) { if ( ! { } . hasOwnProperty . call ( this . language . syntax . operators . aliases , operatorRaw ) ) { return operatorRaw ; } return this . language . syntax . operators . aliases [ operatorRaw ] ; } }