title: typescript compiler api - How to detect if property type is enum or object
body: <p>I have to know each property declaration node, if is enum or another object.</p>
  
  <p>so i get the type reference :</p>
  
  <pre><code> const typeReferance = (arrayType as any).typeName
  </code></pre>
  
  <p>But i don't have any idea how to detect if is enum, or object.</p>
  
  <p>Models:</p>
  
  <pre><code>enum Color { Red, Green, Blue }
  class SomeObject {
      string: string;
  }
  class Model {
      color:Color;
  }
  </code></pre>
  
  <p>The visitor:</p>
  
  <pre><code>if (node.kind === ts.SyntaxKind.PropertyDeclaration) {
    ???
  }
  </code></pre>