<p dir="auto">Hi</p>
<p dir="auto">I create the new "typescript" project.<br>
I generate the description file for the app.ts by <code class="notranslate">tsp --target es5 -d app.ts</code></p>
<p dir="auto">I immediately receive the duplicate identifier error.<br>
I am not sure how to deal with this issue as I want to have both implementation and description files in my project.</p>
<p dir="auto">Here are the files <code class="notranslate">app.ts</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Greeter {
    element: HTMLElement;
    span: HTMLElement;
    timerToken: number;

    constructor(element: HTMLElement) {
        this.element = element;
        this.element.innerHTML += &quot;The time is: &quot;;
        this.span = document.createElement('span');
        this.element.appendChild(this.span);
        this.span.innerText = new Date().toUTCString();
    }

    start() {
        this.timerToken = setInterval(() =&gt; this.span.innerHTML = new Date().toUTCString(), 500);
    }

    stop() {
        clearTimeout(this.timerToken);
    }

}

window.onload = () =&gt; {
    var el = document.getElementById('content');
    var greeter = new Greeter(el);
    greeter.start();
};"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Greeter</span> <span class="pl-kos">{</span>
    <span class="pl-c1">element</span>: <span class="pl-c1">HTMLElement</span><span class="pl-kos">;</span>
    <span class="pl-c1">span</span>: <span class="pl-c1">HTMLElement</span><span class="pl-kos">;</span>
    <span class="pl-c1">timerToken</span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>

    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">element</span>: <span class="pl-v">HTMLElement</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">element</span> <span class="pl-c1">=</span> <span class="pl-s1">element</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">element</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">+=</span> <span class="pl-s">"The time is: "</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">span</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">createElement</span><span class="pl-kos">(</span><span class="pl-s">'span'</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">element</span><span class="pl-kos">.</span><span class="pl-en">appendChild</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">span</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">span</span><span class="pl-kos">.</span><span class="pl-c1">innerText</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toUTCString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-en">start</span><span class="pl-kos">(</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">timerToken</span> <span class="pl-c1">=</span> <span class="pl-en">setInterval</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">span</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toUTCString</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">500</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-en">stop</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">clearTimeout</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">timerToken</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

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

<span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-en">onload</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">el</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">'content'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">greeter</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Greeter</span><span class="pl-kos">(</span><span class="pl-s1">el</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">greeter</span><span class="pl-kos">.</span><span class="pl-en">start</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></pre></div>
<p dir="auto">and <code class="notranslate">app.d.ts</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="declare class Greeter {
    element: HTMLElement;
    span: HTMLElement;
    timerToken: number;
    constructor(element: HTMLElement);
    start(): void;
    stop(): void;
}"><pre class="notranslate"><span class="pl-s1">declare</span> <span class="pl-k">class</span> <span class="pl-v">Greeter</span> <span class="pl-kos">{</span>
    <span class="pl-c1">element</span>: <span class="pl-c1">HTMLElement</span><span class="pl-kos">;</span>
    <span class="pl-c1">span</span>: <span class="pl-c1">HTMLElement</span><span class="pl-kos">;</span>
    <span class="pl-c1">timerToken</span>: <span class="pl-s1">number</span><span class="pl-kos">;</span>
    <span class="pl-c1">constructor</span><span class="pl-kos">(</span><span class="pl-s1">element</span>: <span class="pl-v">HTMLElement</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-c1">start</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-k">void</span><span class="pl-kos">;</span>
    <span class="pl-c1">stop</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-k">void</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I have object with function like this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="db.query({ /* queryParameter */ },function(err,data) {  });"><pre class="notranslate"><code class="notranslate">db.query({ /* queryParameter */ },function(err,data) {  });
</code></pre></div>
<p dir="auto">So I write jsdoc for pass this object in my function. And it got error</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1042507/12941269/59f92d56-d003-11e5-8728-9e6b8635b4c0.png"><img src="https://cloud.githubusercontent.com/assets/1042507/12941269/59f92d56-d003-11e5-8728-9e6b8635b4c0.png" alt="screen shot 2559-02-10 at 2 30 14 pm" style="max-width: 100%;"></a></p>
<p dir="auto">Also jsdoc is not support both <code class="notranslate">@typedef</code> and <code class="notranslate">@callback</code> so I got stuck here</p>