title: export classes and function in typescript
body: <p>In my angularJS I have seperate JS file wherein prototype functions are declared like below:</p>
  
  <pre><code>function lastConversation(){
   this.item1="1"
   this.message="test"
  ......
  
  }
  lastConversation.prototype.setupfromMessageThread(data) {
    this.currentBox = data.currentBox ||  null;
    data.internalId = data.internalId ||  null;
    this.addParticipants(data.participants);
  }
  
  lastConversation.prototype.addParticipants = function (participants) {
  }
  </code></pre>
  
  <p>I wanted to similar stuff in angular 6 and created class</p>
  
  <pre><code>export class conversation {
  
  constructor(json?: any) {
      if (!json) return;
     this.item=json.internalId || 0;
    }
  
   setupfromMessageThread(conversation) {
      this.internalId = conversation.internalId || null; }}
  </code></pre>
  
  <p>However when in my ts file when I use </p>
  
  <pre><code>lastconveration = new dataModel.Conversation()
  lastconveration.setupfromMessageThread(conversation) 
  </code></pre>
  
  <p>it says setupfromMessageThread is not function. if I wanted to use same angularJs function do I need to use export before each function or in case of angular6 what I am missing.</p>