flpvsk / gatsby-plugin-gtag

Gatsby plugin to add Google Analytics gtag.js (replacement for analytics.js) to a site.
MIT License
28 stars 12 forks source link

Add Typescript typings #9

Closed BPScott closed 5 years ago

BPScott commented 5 years ago

Copied from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-google-analytics/index.d.ts


Adding this file to my node_modules/gatsby-plugin-gtag stops typescript complaining when I import gatsby-plugin-gtag. The error

error TS7016: Could not find a declaration file for module 'gatsby-plugin-gtag'. '/Users/benscott/src/github.com/Shopify/polaris-icons/node_modules/gatsby-plugin-gtag/index.js' implicitly has an 'any' type.
  Try `npm install @types/gatsby-plugin-gtag` if it exists or add a new declaration (.d.ts) file containing `declare module 'gatsby-plugin-gtag';`

14 import {OutboundLink} from 'gatsby-plugin-gtag';

is now removed.

flpvsk commented 5 years ago

Published as v1.0.9 thanks!