import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; import { SingleParameter } from "./Metadata/Parameters/SingleParameter" ; /**
 * Parses a language's alias for a type.
 */ export class TypeCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . Type ) . withDescription ( "Parses a language's alias for a type" ) . withParameters ( [ new SingleParameter ( "type" , "A type to parse." , true ) ] ) ; returns public getMetadata ( ) { return TypeCommand . metadata ; } param parameters returns public render ( parameters ) { return this . convertType ( parameters [ 1 ] ) ; } param typeNameRaw returns private convertType ( typeNameRaw ) { let typeName = typeNameRaw ; if ( { } . hasOwnProperty . call ( this . language . syntax . classes . aliases , typeName ) ) { typeName = this . language . syntax . classes . aliases [ typeName ] ; } return LineResults . newSingleLine ( typeName ) ; } }