diff --git a/packages/gatsby-link/index.d.ts b/packages/gatsby-link/index.d.ts index 69cebfaaa1826..c8c2ec1328831 100644 --- a/packages/gatsby-link/index.d.ts +++ b/packages/gatsby-link/index.d.ts @@ -1,5 +1,5 @@ import * as React from "react" -import { NavigateFn, LinkProps } from "@reach/router" // These come from `@types/reach__router` +import { NavigateOptions, LinkProps } from "@reach/router" // These come from `@types/reach__router` // eslint-disable-next-line @typescript-eslint/naming-convention export interface GatsbyLinkProps extends LinkProps { @@ -33,7 +33,10 @@ export class Link extends React.Component< * Sometimes you need to navigate to pages programmatically, such as during form submissions. In these * cases, `Link` won’t work. */ -export const navigate: (...args: Parameters) => void; +export const navigate: { + (to: string, options?: NavigateOptions<{}>): void + (to: number): void +} /** * It is common to host sites in a sub-directory of a site. Gatsby lets you set the path prefix for your site.