From be1341157ad1ae61b2a19ffe1f84759add9a9e77 Mon Sep 17 00:00:00 2001 From: Trevor Harmon Date: Thu, 29 Nov 2018 19:07:38 -0800 Subject: [PATCH 1/4] Added typings for google analytics plugin --- packages/gatsby-plugin-google-analytics/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/gatsby-plugin-google-analytics/index.d.ts diff --git a/packages/gatsby-plugin-google-analytics/index.d.ts b/packages/gatsby-plugin-google-analytics/index.d.ts new file mode 100644 index 0000000000000..ff41e5e87724a --- /dev/null +++ b/packages/gatsby-plugin-google-analytics/index.d.ts @@ -0,0 +1,8 @@ + import * as React from "react"; + + interface OutboundLinkProps { + onClick?: (event: React.MouseEvent) => void; + } + + class OutboundLink extends React.Component, any> {} + export { OutboundLink }; From 93df84fcbc8eccc431e68939dd4a6ef1782cb042 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Mon, 28 Jan 2019 16:37:23 +0100 Subject: [PATCH 2/4] chore: format --- examples/using-typescript/src/layouts/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/using-typescript/src/layouts/index.tsx b/examples/using-typescript/src/layouts/index.tsx index 19fc8bea387d5..b29d000c54d30 100644 --- a/examples/using-typescript/src/layouts/index.tsx +++ b/examples/using-typescript/src/layouts/index.tsx @@ -1,4 +1,5 @@ import * as React from "react" +import { OutboundLink } from "gatsby-plugin-google-analytics" import { rhythm } from "../utils/typography" @@ -13,6 +14,11 @@ const MainLayout: React.SFC = ({ children }) => ( paddingRight: rhythm(3 / 4), }} > + { + e.preventDefault() + }} + /> {children} ) From 97fe3513f4a700fd914dfdc80d0459f2b4462671 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Mon, 28 Jan 2019 16:40:49 +0100 Subject: [PATCH 3/4] ops - revert manual testing --- examples/using-typescript/src/layouts/index.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/using-typescript/src/layouts/index.tsx b/examples/using-typescript/src/layouts/index.tsx index b29d000c54d30..19fc8bea387d5 100644 --- a/examples/using-typescript/src/layouts/index.tsx +++ b/examples/using-typescript/src/layouts/index.tsx @@ -1,5 +1,4 @@ import * as React from "react" -import { OutboundLink } from "gatsby-plugin-google-analytics" import { rhythm } from "../utils/typography" @@ -14,11 +13,6 @@ const MainLayout: React.SFC = ({ children }) => ( paddingRight: rhythm(3 / 4), }} > - { - e.preventDefault() - }} - /> {children} ) From 1fc781aed3816ddf5ed9a34027a200d70aa6c5c0 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Mon, 28 Jan 2019 16:41:22 +0100 Subject: [PATCH 4/4] format --- .../gatsby-plugin-google-analytics/index.d.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/gatsby-plugin-google-analytics/index.d.ts b/packages/gatsby-plugin-google-analytics/index.d.ts index ff41e5e87724a..60693b98a1933 100644 --- a/packages/gatsby-plugin-google-analytics/index.d.ts +++ b/packages/gatsby-plugin-google-analytics/index.d.ts @@ -1,8 +1,11 @@ - import * as React from "react"; +import * as React from "react" - interface OutboundLinkProps { - onClick?: (event: React.MouseEvent) => void; - } +interface OutboundLinkProps { + onClick?: (event: React.MouseEvent) => void +} - class OutboundLink extends React.Component, any> {} - export { OutboundLink }; +class OutboundLink extends React.Component< + OutboundLinkProps & React.HTMLProps, + any +> {} +export { OutboundLink }