<p dir="auto">Why Typescript has not the static classes like in Java, while Javascript has supported this.</p>
<p dir="auto">If I wrote in JS:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    var ParentClass = (function () {
        function ParentClass() {

        }
        ParentClass.prototype.someMethod = function () {

        };

        ParentClass.StaticClass = (function () {
            function StaticClass() {

            }
            StaticClass.prototype.someMethodInStaticClass = function () {
                return &quot;Hello, &quot; + this.greeting;
            };

            return StaticClass;
        })();
        return ParentClass;
    })();

    var entity = new ParentClass.StaticClass();
    console.log(entity instanceof ParentClass.StaticClass); // true"><pre class="notranslate">    <span class="pl-k">var</span> <span class="pl-v">ParentClass</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">function</span> <span class="pl-v">ParentClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

        <span class="pl-kos">}</span>
        <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">someMethod</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

        <span class="pl-kos">}</span><span class="pl-kos">;</span>

        <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">function</span> <span class="pl-v">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

            <span class="pl-kos">}</span>
            <span class="pl-v">StaticClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">someMethodInStaticClass</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
                <span class="pl-k">return</span> <span class="pl-s">"Hello, "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">greeting</span><span class="pl-kos">;</span>
            <span class="pl-kos">}</span><span class="pl-kos">;</span>

            <span class="pl-k">return</span> <span class="pl-v">StaticClass</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">return</span> <span class="pl-v">ParentClass</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">var</span> <span class="pl-s1">entity</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">entity</span> <span class="pl-k">instanceof</span> <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// true</span></pre></div>
<p dir="auto">This is correct, but:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    class parentClass {
        someMethod() {}

        {static} class StaticClass {
        someMethodInStaticClass() {}
        }
    }

    var entity = new ParentClass.StaticClass();
    console.log(entity instanceof ParentClass.StaticClass); // true"><pre class="notranslate">    <span class="pl-k">class</span> <span class="pl-smi">parentClass</span> <span class="pl-kos">{</span>
        <span class="pl-en">someMethod</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span>

        <span class="pl-kos">{</span><span class="pl-s1">static</span><span class="pl-kos">}</span> <span class="pl-k">class</span> <span class="pl-smi">StaticClass</span> <span class="pl-kos">{</span>
        <span class="pl-en">someMethodInStaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">var</span> <span class="pl-s1">entity</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">entity</span> <span class="pl-k">instanceof</span> <span class="pl-smi">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// true</span></pre></div>
<p dir="auto">This is incorrect although it can compile into silimar JS.</p>
<p dir="auto">P.S. I'm sorry for bad markup</p>
<h1 dir="auto">Introduction</h1>
<p dir="auto">Currently, in TypeScript, we support only one of the two styles of creating classes in ES6 - that of class declarations.  This proposal adds support for the other style, class expressions.  This will fill our support for classes in ES6 and help bring us in alignment with both styles.</p>
<h1 dir="auto">Class Expressions vs Class Declarations</h1>
<p dir="auto">Class expressions work a little differently than class declarations.  Here's a list of the highlights:</p>
<ul dir="auto">
<li>Class expressions have an optional 'BindingIdentifier' or class name.  This allows them to create anonymous classes, or name them, as the programmer sees fit.</li>
<li>Unlike class declarations, class expressions with a name do not introduce this name to the lexical scope outside of the class.  The class name of a class expression is only visible inside the body of the class expression.</li>
<li>Unlike class declarations, class expressions would not create named types in the lexical scope outside of the class.  Instead, the named type would only be visible inside the class expression, bound to the class name.  Outside of the class expression, they would have anonymous types with the shape of the constructor function.</li>
</ul>
<p dir="auto">Just as with class declarations, class expressions would create a constructor function that can be used to construct instances.  Like class declarations, you may also declare property members and index members, as well as use the constructor parameters.</p>
<h1 dir="auto">Examples</h1>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var Rect = class { 
  area: number;

  constructor(public length: number, public width: number) {
    this.area = this.length * this.width;
  }
}
var rect = new Rect(5, 10);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-smi">Rect</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-kos">{</span> 
  <span class="pl-c1">area</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>

  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">public</span> <span class="pl-s1">length</span>: <span class="pl-smi">number</span><span class="pl-kos">,</span> <span class="pl-k">public</span> <span class="pl-s1">width</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">area</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">*</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">width</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">rect</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Rect</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var MyNode = class Node {
  next: Node;

  set nextNode(node: Node) {
    this.next = node;
  }
  constructor() {  }
}
var node = new MyNode();
var nextNode = new MyNode();
node.nextNode = nextNode;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-smi">MyNode</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-smi">Node</span> <span class="pl-kos">{</span>
  <span class="pl-c1">next</span>: <span class="pl-smi">Node</span><span class="pl-kos">;</span>

  <span class="pl-k">set</span> <span class="pl-en">nextNode</span><span class="pl-kos">(</span><span class="pl-s1">node</span>: <span class="pl-smi">Node</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">next</span> <span class="pl-c1">=</span> <span class="pl-s1">node</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">node</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">MyNode</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">nextNode</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">MyNode</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">node</span><span class="pl-kos">.</span><span class="pl-c1">nextNode</span> <span class="pl-c1">=</span> <span class="pl-s1">nextNode</span><span class="pl-kos">;</span></pre></div>
<h1 dir="auto">Emit</h1>
<p dir="auto">Class expressions, just like class declarations, create a constructor function.  We would emit them similarly to how we do now, with the exception that they are not immediately bound to a variable.  Instead, they create the function expression (IIFE) that builds the constructor function, and allows the developer to assign the result of this expression where appropriate.</p>
<h1 dir="auto">Emit of .d.ts</h1>
<p dir="auto">The type emitted for class expressions is the object literal representation of the constructor functions, just as with other anonymous types.</p>
<p dir="auto">Class expressions can also introduce recursion in the type literal.  Anonymous types that have possibly recursive components (like the Node example above) will need special treatment, which should be part of a related spec (<strong>Edit:</strong> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40960217" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/517" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/517/hovercard" href="https://github.com/microsoft/TypeScript/issues/517">#517</a>).</p>