Skip to content

v3.1.2

Compare
Choose a tag to compare
@lukeed lukeed released this 08 May 18:05
· 3 commits to master since this release

Chores

  • NEW Added TypeScript support! (#11, #13): 1666f00, 54d05da, fb80bb9

    Thank you @rand0me~!

    Definitions include and export interfaces for all Event data objects, and will also swap the inferred interface for you based on the .send(...) value.

    import GAnalytics from "ganalytics";
    
    const GA = GAnalytics('UA-asd', {
      //
    });
    
    GA.send('pageview');
    GA.send('exception');
    
    GA.send('transaction');
    // Argument of type '"transaction"' is not assignable to parameter of type 'EventOptional'
    
    GA.send('event', {
      ec: 123
      // Type 'number' is not assignable to type 'string'.ts(2322)
      // The expected type comes from property 'ec' which is declared here on type 'EventParams'
    });
  • Update build tool: 8e5f096