title: typescript - declare structure of subobjects
body: <p>How can I declare structure of objects being children of another objects? I don't know number of children at compile time.</p>
  
  <pre><code>let obj = {
      child1: {id: 1, name: "Name id1"},
      child2: {id: 2, name: "Name id2"},
      child3: {id: 3, name: "Name id3"},
      child4: {id: 4, name: "Name id4"},
      child5: {id: 5, name: "Name id5"},
      child6: {id: 6, name: "Name id6"},
  }
  </code></pre>
  
  <p>So I want to declare type (or interface) <code>{id: number, name: string}</code> and that <code>obj</code> can have any property name and value for this property of this new type.</p>