title: IDB: typescript definition for EventTarget
body: <p>I use IDB with typescript, and trying to define the EventTarget so I can get result and error from it.</p>
  
  <p>typically for actions one get the error as <code>event.target.error</code> and result <code>event.target.result</code>. </p>
  
  <pre><code>var request = objectStore.add(data);
          request.onerror = function(event) {
            console.log(event.target.error)
          }
          request.onsuccess = function(event) {
            callback(event.target.error,event.target.result);
          };
  </code></pre>
  
  <p>I tried like below</p>
  
  <pre><code>interface EventTarget {
      error?: any;
      result: any;
  }
  </code></pre>
  
  <p>which gives lot of unrelated error. I use the latest development branch (de583a588d7be350ac5108118a807715fcf83519).</p>
  
  <p>what can I do to </p>
  
  <pre><code>Using tsc v1.0.0
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11030,11): error TS2189: Interface 'SVGFEFloodElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11100,11): error TS2189: Interface 'SVGFETileElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11108,11): error TS2189: Interface 'SVGFEBlendElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11139,11): error TS2189: Interface 'SVGFEMergeElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11262,11): error TS2189: Interface 'SVGFEGaussianBlurElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11339,11): error TS2189: Interface 'SVGFESpecularLightingElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11442,11): error TS2189: Interface 'SVGFEMorphologyElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11473,11): error TS2189: Interface 'SVGFEDisplacementMapElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11614,11): error TS2189: Interface 'SVGFEConvolveMatrixElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11664,11): error TS2189: Interface 'SVGFETurbulenceElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11709,11): error TS2189: Interface 'SVGFEColorMatrixElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(11820,11): error TS2189: Interface 'SVGFEOffsetElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(12102,11): error TS2189: Interface 'SVGFEImageElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(12116,11): error TS2189: Interface 'SVGFECompositeElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(12206,11): error TS2189: Interface 'SVGFEComponentTransferElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  /usr/local/lib/node_modules/typescript/bin/lib.d.ts(12214,11): error TS2189: Interface 'SVGFEDiffuseLightingElement' cannot simultaneously extend types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes':
  Named properties 'result' of types 'SVGElement' and 'SVGFilterPrimitiveStandardAttributes' are not identical.
  &gt;&gt; Compilation failed
  </code></pre>
  
  <h2>EDIT:</h2>
  
  <p>I could see target is used in SVGAElement (or in Event),</p>
  
  <pre><code>interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference {
      target: SVGAnimatedString;
  }
  </code></pre>
  
  <p>What I try is to extend <code>EventTarget</code> with <code>error</code> and <code>result</code>.</p>
  
  <p>I am not sure how these cyclic extension of <code>EventTarget</code> works. I am new to Typescript.</p>
  
  <pre><code>interface IDBRequest extends EventTarget {
    onsuccess: (ev: Event) =&gt; any;
    onerror: (ev: ErrorEvent) =&gt; any;
  
  interface Event {
     ....
      target: EventTarget;
      eventPhase: number;
     ....
  </code></pre>