title: Why does retrofitting types onto soemthing untyped require a new npm package?
body: <p>Suppose that a package <code>foo</code> exists on <code>npm</code> which isn't typed, and I decide to locally write types for it in the style of <code>DefinitelyTyped</code>.</p>
  <p>This situation was described in <a href="https://stackoverflow.com/q/44796039/1412255">this question</a> and the accepted answer tells you how to fake a &quot;local npm package&quot; to load these type declarations.</p>
  <p>But why can't these types exist as a regular file (or even - a part of a file!) in my project? Does the typescript compiler give a special designation to packages -- in that packages can be used to declare types like this but files cannot?</p>