title: d3 v4 drag and drop with TypeScript
body: <p>I am using the D3 library v4 and Angular2 and I want to make a drag and drop of svg elements. I have a code:</p>
  
  <pre><code>item.call(
      d3.drag()
        .on("start", dragStarted)
        .on("drag", dragged)
        .on("end", dragEnded)
    );
  </code></pre>
  
  <p>and</p>
  
  <pre><code>function  dragStarted(d) {
      d3.select(this).raise().classed("active", true);
  }
  
  function  dragged(d) {
      d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y);
  }
  
  function  dragEnded(d) {
      d3.select(this).classed("active", false);
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>TS2345: Argument of type 'DragBehavior' is not assignable to parameter of type '(selection: Selection, ...args: any[]) => void'.
      Types of parameters 'selection' and 'selection' are incompatible.
        Type 'Selection' is not assignable to type 'Selection'.
          Type 'BaseType' is not assignable to type 'Element'.
            Type 'EnterElement' is not assignable to type 'Element'.
              Property 'classList' is missing in type 'EnterElement'. </p>
  </blockquote>
  
  <p>Any ideas?</p>