-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
index.d.ts
44 lines (40 loc) · 1.76 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as React from "react"
import { NavigateFn, LinkProps } from "@reach/router"
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface GatsbyLinkProps<TState> extends LinkProps<TState> {
/** A class to apply when this Link is active */
activeClassName?: string
/** Inline styles for when this Link is active */
activeStyle?: object
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void
/** Class the link as highlighted if there is a partial match via a the `to` being prefixed to the current url */
partiallyActive?: boolean
/** Used to declare that this link replaces the current URL in history with the target */
replace?: boolean
/** Used to pass state data to the linked page.
* The linked page will have a `location` prop containing a nested `state` object structure containing the passed data.
*/
state?: TState
/** The URL you want to link to */
to: string
}
/**
* This component is intended _only_ for links to pages handled by Gatsby. For links to pages on other
* domains or pages on the same domain not handled by the current Gatsby site, use the normal `<a>` element.
*/
export default class GatsbyLink<TState> extends React.Component<
GatsbyLinkProps<TState>,
any
> {}
/**
* Sometimes you need to navigate to pages programmatically, such as during form submissions. In these
* cases, `Link` won’t work.
*/
export const navigate: NavigateFn
/**
* It is common to host sites in a sub-directory of a site. Gatsby lets you set the path prefix for your site.
* After doing so, Gatsby's `<Link>` component will automatically handle constructing the correct URL in
* development and production
*/
export const withPrefix: (path: string) => string
export const withAssetPrefix: (path: string) => string