<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
</ul>
<p dir="auto">Currently, using the <code class="notranslate">"peerDependencies"</code> field in package.json is forbidden:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; dtslint types &quot;my-plugin&quot;

Error: .../my-plugin/package.json should not include field peerDependencies"><pre class="notranslate"><code class="notranslate">&gt; dtslint types "my-plugin"

Error: .../my-plugin/package.json should not include field peerDependencies
</code></pre></div>
<p dir="auto">Some library definitions may depend on a host package version which should not be imported twice, e.g. due to the host packages exporting duplicate definitions in this case. This can happen when the application requires a different version of the host package than the definitions of the library.</p>
<p dir="auto">Using <code class="notranslate">"peerDependencies"</code> solves this problem by only allowing a single specific version of the host package to be installed.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/d3-hexbin</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have <a href="https://stackoverflow.com/questions/45805742/d3-and-d3-hexbin-in-typescript-as-global-libraries" rel="nofollow">a question</a> that is ignored in StackOverflow (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/uncovertruth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/uncovertruth">@uncovertruth</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomwanzek/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomwanzek">@tomwanzek</a></li>
</ul>
</li>
</ul>
<hr>
<p dir="auto">So, I'm using <code class="notranslate">d3</code> and <code class="notranslate">d3-hexbin</code> as global libraries:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;script src=&quot;https://d3js.org/d3.v4.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://d3js.org/d3-hexbin.v0.2.min.js&quot;&gt;&lt;/script&gt;"><pre class="notranslate"><code class="notranslate">&lt;script src="https://d3js.org/d3.v4.min.js"&gt;&lt;/script&gt;
&lt;script src="https://d3js.org/d3-hexbin.v0.2.min.js"&gt;&lt;/script&gt;
</code></pre></div>
<p dir="auto">... and referencing them in <code class="notranslate">.ts</code> as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference types=&quot;d3&quot; /&gt;
/// &lt;reference types=&quot;d3-hexbin&quot; /&gt;"><pre class="notranslate"><code class="notranslate">/// &lt;reference types="d3" /&gt;
/// &lt;reference types="d3-hexbin" /&gt;
</code></pre></div>
<p dir="auto">However, although this works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const svg = d3.select('#hitmap')"><pre class="notranslate"><code class="notranslate">const svg = d3.select('#hitmap')
</code></pre></div>
<p dir="auto">... this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const hexbin = d3.hexbin()"><pre class="notranslate"><code class="notranslate">const hexbin = d3.hexbin()
</code></pre></div>
<p dir="auto">... fails with a :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Property 'hexbin' does not exist on type 
  'typeof &quot;/Users/bytter/node_modules/@types/d3/index&quot;'"><pre class="notranslate"><code class="notranslate">Property 'hexbin' does not exist on type 
  'typeof "/Users/bytter/node_modules/@types/d3/index"'
</code></pre></div>
<p dir="auto">By looking at the <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/d3-hexbin/d3-hexbin-tests.ts">tests</a>, I can see that:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as d3Hexbin from 'd3-hexbin';"><pre class="notranslate"><code class="notranslate">import * as d3Hexbin from 'd3-hexbin';
</code></pre></div>
<p dir="auto">Would export the <code class="notranslate">hexbin()</code> function directly into the <code class="notranslate">d3Hexbin</code> namespace, but I'm unable to figure out how to conciliate this with <code class="notranslate">d3-hexbin</code> as a global library.</p>