title: Need example of using fabricjs.d.ts with TypeScript
body: <p>I use fabricjs in a project I'm attempting to convert to use TypeScript but I can't figure out how to use it. Previously I'd create my own custom objects by doing the following:</p>
  
  <pre><code>my.namespace.Control = fabric.util.createClass(fabric.Object, {
      id: "",
      type: 'Control',
      color: "#000000", 
      ...
  });
  </code></pre>
  
  <p>In my new project, I've installed the TypeDefinition file from <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/fabricjs/fabricjs.d.ts" rel="noreferrer">here</a> but I can't figure out how I should use it? </p>
  
  <p>Looking at the .d.ts file, fabric.Object doesn't appear to be a Function so isn't allowed to be passed to createClass, and createClass itself returns void, so I can't assign the value to a variable.</p>
  
  <p>Even if all this worked, how should I format this so it works the TypeScript way? ie, what do I export so that I can import it elsewhere where the Control class is needed?</p>
  
  <p>Anyone actually got any examples of doing this?</p>