<?xml version="1.0" encoding="utf-8"?>
<!--Copyright, Microsoft Corporation, All rights reserved.-->
<Rule
  Name="TypeScriptBuild"
  DisplayName="TypeScript"
  PageTemplate="generic"
  Description="TypeScript Build Properties"
  xmlns="http://schemas.microsoft.com/build/2009/properties">

  <Rule.Categories>
    <Category Name="General" DisplayName="General" />
    <Category Name="Output" DisplayName="Output" />
    <Category Name="Debugging" DisplayName="Debugging" />
  </Rule.Categories>

  <Rule.DataSource>
    <DataSource Persistence="ProjectFile" Label="Configuration" />
  </Rule.DataSource>

  <!-- General -->
  <EnumProperty
    Name="TypeScriptTarget"
    DisplayName="ECMAScript version"
    Category="General"
    Description="ECMAScript version to use for generated JavaScript" >
    <EnumValue Name="ES3" DisplayName="ECMAScript 3" />
    <EnumValue Name="ES5" DisplayName="ECMAScript 5" />
    <EnumValue Name="ES6" DisplayName="ECMAScript 6" />
    <EnumValue Name="ES2016" DisplayName="ECMAScript 2016" />
    <EnumValue Name="ES2017" DisplayName="ECMAScript 2017" />
    <EnumValue Name="ES2018" DisplayName="ECMAScript 2018" />
    <EnumValue Name="ES2019" DisplayName="ECMAScript 2019" />
    <EnumValue Name="ES2020" DisplayName="ECMAScript 2020" />
    <EnumValue Name="ES2021" DisplayName="ECMAScript 2021" />
    <EnumValue Name="ESNext" DisplayName="ECMAScript Next" />
  </EnumProperty>

  <EnumProperty
    Name="TypeScriptJSXEmit"
    DisplayName="Compilation mode for .tsx files"
    Category="General"
    Description="Specify JSX code compilation mode for .tsx files, this doesn't affect .ts files">
    <EnumProperty.DataSource>
      <!-- Indicates there is an interceptor used to specify the default value for TypeScriptJSXEmit -->
      <DataSource HasConfigurationCondition="False"
                  Persistence="ProjectFileWithInterception" />
    </EnumProperty.DataSource>
    <EnumValue Name="none" DisplayName="None"/>
    <EnumValue Name="preserve" DisplayName="Preserve JSX elements" />
    <EnumValue Name="react" DisplayName="Emit React call for JSX elements" />
  </EnumProperty>

  <EnumProperty
    Name="TypeScriptModuleKind"
    DisplayName="Module system"
    Category="General"
    Description="External module code generation target">
    <EnumProperty.DataSource>
      <!-- Indicates there is an interceptor used to specify the default value for TypeScriptModuleKind -->
      <DataSource HasConfigurationCondition="False"
                  Persistence="ProjectFileWithInterception" />
    </EnumProperty.DataSource>
    <EnumValue Name="none" DisplayName="None" />
    <EnumValue Name="amd" DisplayName="AMD" />
    <EnumValue Name="commonjs" DisplayName="CommonJS" />
    <EnumValue Name="umd" DisplayName="UMD" />
    <EnumValue Name="system" DisplayName="System" />
  </EnumProperty>

  <BoolProperty
    Name="TypeScriptCompileOnSaveEnabled"
    DisplayName="Compile on save"
    Category="General"
    Description="Recompile sources on save" />

  <BoolProperty
    Name="TypeScriptNoImplicitAny"
    DisplayName="Do not allow implicit 'any' types"
    Category="General"
    Description="Enable warnings on expressions and declarations with an implied 'any' type" />

  <!-- Output -->
  <BoolProperty
    Name="TypeScriptRemoveComments"
    DisplayName="Remove comments from JavaScript output"
    Category="Output"
    Description="Do not emit comments to output" />

  <StringProperty
    Name="TypeScriptOutFile"
    DisplayName="Combine JavaScript output into file"
    Category="Output"
    Description="Redirect output to a file" />

  <StringProperty
    Name="TypeScriptOutDir"
    DisplayName="Redirect JavaScript output to directory"
    Category="Output"
    Description="Redirect output to a different directory than sources" />

  <BoolProperty
    Name="TypeScriptGeneratesDeclarations"
    DisplayName="Generate declaration files"
    Category="Output"
    Description="Generate corresponding d.ts file" />

  <BoolProperty
   Name="TypeScriptNoEmitOnError"
   DisplayName="Do not emit outputs if any errors are reported"
   Category="Output"
   Description="Doesn't emit output if errors are found" />

  <!-- Debugging -->
  <BoolProperty
    Name="TypeScriptSourceMap"
    DisplayName="Generate source maps"
    Category="Debugging"
    Description="Generates corresponding .map file" />

  <StringProperty
    Name="TypeScriptMapRoot"
    DisplayName="Specify root directory of source maps"
    Category="Debugging"
    Description="Emits the sourcemaps such that soucemaps while debugging will be located in the sourcemap root" />

  <StringProperty
    Name="TypeScriptSourceRoot"
    DisplayName="Specify root directory of TypeScript files"
    Category="Debugging"
    Description="Emits the sourcemaps such that sources while debugging will be located in the source root" />

</Rule>
