From 668ad1ac7b59ec89c08789b1fb2fa9f3fc7c7817 Mon Sep 17 00:00:00 2001 From: Niko Simonson Date: Wed, 31 Jan 2018 19:46:33 -0800 Subject: [PATCH] Update navigateTo types --- packages/gatsby-link/index.d.ts | 3 ++- packages/gatsby-link/package.json | 1 + yarn.lock | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-link/index.d.ts b/packages/gatsby-link/index.d.ts index 70510e4f56f18..cd97a84ec0065 100644 --- a/packages/gatsby-link/index.d.ts +++ b/packages/gatsby-link/index.d.ts @@ -1,5 +1,6 @@ import * as React from "react"; import { NavLinkProps } from "react-router-dom"; +import { LocationDescriptor } from "history"; export interface GatsbyLinkProps extends NavLinkProps { onClick?: (event: any) => void @@ -7,7 +8,7 @@ export interface GatsbyLinkProps extends NavLinkProps { style?:any; } -export const navigateTo: (path: string) => void; +export const navigateTo: (to: LocationDescriptor) => void; export const withPrefix: (path: string) => string; diff --git a/packages/gatsby-link/package.json b/packages/gatsby-link/package.json index a974d1143509e..92dd115d4948b 100644 --- a/packages/gatsby-link/package.json +++ b/packages/gatsby-link/package.json @@ -23,6 +23,7 @@ "gatsby": "^1.0.0" }, "dependencies": { + "@types/history": "^4.6.2", "@types/react-router-dom": "^4.2.2", "babel-runtime": "^6.26.0", "prop-types": "^15.5.8", diff --git a/yarn.lock b/yarn.lock index 6749c6ffd74cc..e36ecd84dd0a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,10 @@ # yarn lockfile v1 +"@types/history@*", "@types/history@^4.6.2": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" + "@types/inline-style-prefixer@^3.0.0": version "3.0.1" resolved "https://registry.yarnpkg.com/@types/inline-style-prefixer/-/inline-style-prefixer-3.0.1.tgz#8541e636b029124b747952e9a28848286d2b5bf6" @@ -14,6 +18,21 @@ version "6.0.90" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.90.tgz#0ed74833fa1b73dcdb9409dcb1c97ec0a8b13b02" +"@types/react-router-dom@^4.2.2": + version "4.2.3" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.2.3.tgz#06e0b67ff536adc0681dffdbe592ae91fb85887d" + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react-router" "*" + +"@types/react-router@*": + version "4.0.21" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.21.tgz#d6c7ea3b45dba02eb8f869629f3b7d7b6e9a7938" + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react@*": version "16.0.18" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.18.tgz#c08eea79ada55bf10b5353e18c21797dd17afa23" @@ -11970,6 +11989,10 @@ shallow-clone@^0.1.2: lazy-cache "^0.2.3" mixin-object "^2.0.1" +shallow-compare@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/shallow-compare/-/shallow-compare-1.2.2.tgz#fa4794627bf455a47c4f56881d8a6132d581ffdb" + shallow-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.0.0.tgz#508d1838b3de590ab8757b011b25e430900945f7"