[d3-cloud] Support import syntax (#30479)

* Allow importing from `d3-cloud`

* Modify export to be CommonJS
This commit is contained in:
Oscar Busk
2018-12-31 10:13:42 -08:00
committed by Sheetal Nandi
parent 6d9584582e
commit 9272fc1637
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -1,3 +1,12 @@
import d3Cloud = require('./index.d');
import d3 = require('d3');
// $ExpectType Cloud<Word>
d3Cloud();
// $ExpectType Cloud<Word>
d3.layout.cloud();
interface ICompTextSize{
text:string;
size:number;
+2
View File
@@ -5,6 +5,8 @@
import * as d3 from 'd3';
export = d3.layout.cloud;
declare module 'd3' {
namespace layout {
export function cloud(): Cloud<cloud.Word>;