title: Advanced JSDoc (TypeScript)
body: <p><strong>Primary problem: I need type extending any object structure with the concrete object structure.</strong></p>
  
  <p>Default I tested in VS Code.</p>
  
  <p>My solution proposal:</p>
  
  <pre><code>/** @template A @typedef {{[Ki in keyof A]:       A[Ki] } &amp; {[k: string]:       {} } &amp; A} Deep3 */
  /** @template A @typedef {{[Ki in keyof A]: Deep3&lt;A[Ki]&gt;} &amp; {[k: string]: Deep3&lt;{}&gt;} &amp; A} Deep2 */
  /** @template A @typedef {{[Ki in keyof A]: Deep2&lt;A[Ki]&gt;} &amp; {[k: string]: Deep2&lt;{}&gt;} &amp; A} Deep */
  
  /** @type {Deep&lt;{a: {b: number}}&gt;} */
  let x = {a: {b: 9, c: {d: 8}}};     // ERROR: Type 'number' is not assignable to type '{ [k: string]: {}; }'
  x.a.c.d = 9;    // OK
  </code></pre>
  
  <p>Problem resulting from my solution proposal:</p>
  
  <pre><code>/** @type {Number &amp; {[k: string]: Number}} */
  let a = 9;          // ERROR: Type '11' is not assignable to type '{ [k: string]: { x: number; }; }'
  a.optional = 9;     // OK
  
  /** @type {Number | {[k: string]: Number}} */
  let b = 9;          // OK
  b.optional = 9;     // ERROR: Property 'optional' does not exist on type 'number'
  b = 4;
  </code></pre>
  
  <p>This problem is not exists here:</p>
  
  <pre><code>/** @type {Number &amp; {optional?: Number}} */
  let c = 9;          // OK
  c.optional = 9;     // OK
  </code></pre>
  
  <p>In TypeScript is behavior equals.</p>