gatsby-link 4.19.0 → 4.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +44 -0
- package/package.json +4 -3
package/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { NavigateFn, LinkProps } from "@reach/router"
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
|
+
export interface GatsbyLinkProps<TState> extends LinkProps<TState> {
|
|
6
|
+
/** A class to apply when this Link is active */
|
|
7
|
+
activeClassName?: string
|
|
8
|
+
/** Inline styles for when this Link is active */
|
|
9
|
+
activeStyle?: object
|
|
10
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void
|
|
11
|
+
/** Class the link as highlighted if there is a partial match via a the `to` being prefixed to the current url */
|
|
12
|
+
partiallyActive?: boolean
|
|
13
|
+
/** Used to declare that this link replaces the current URL in history with the target */
|
|
14
|
+
replace?: boolean
|
|
15
|
+
/** Used to pass state data to the linked page.
|
|
16
|
+
* The linked page will have a `location` prop containing a nested `state` object structure containing the passed data.
|
|
17
|
+
*/
|
|
18
|
+
state?: TState
|
|
19
|
+
/** The URL you want to link to */
|
|
20
|
+
to: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This component is intended _only_ for links to pages handled by Gatsby. For links to pages on other
|
|
25
|
+
* domains or pages on the same domain not handled by the current Gatsby site, use the normal `<a>` element.
|
|
26
|
+
*/
|
|
27
|
+
export default class GatsbyLink<TState> extends React.Component<
|
|
28
|
+
GatsbyLinkProps<TState>,
|
|
29
|
+
any
|
|
30
|
+
> {}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Sometimes you need to navigate to pages programmatically, such as during form submissions. In these
|
|
34
|
+
* cases, `Link` won’t work.
|
|
35
|
+
*/
|
|
36
|
+
export const navigate: NavigateFn
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* It is common to host sites in a sub-directory of a site. Gatsby lets you set the path prefix for your site.
|
|
40
|
+
* After doing so, Gatsby's `<Link>` component will automatically handle constructing the correct URL in
|
|
41
|
+
* development and production
|
|
42
|
+
*/
|
|
43
|
+
export const withPrefix: (path: string) => string
|
|
44
|
+
export const withAssetPrefix: (path: string) => string
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-link",
|
|
3
3
|
"description": "An enhanced Link component for Gatsby sites with support for resource prefetching",
|
|
4
|
-
"version": "4.19.
|
|
4
|
+
"version": "4.19.1",
|
|
5
5
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/gatsbyjs/gatsby/issues"
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"module": "dist/index.modern.mjs",
|
|
12
12
|
"types": "index.d.ts",
|
|
13
13
|
"files": [
|
|
14
|
-
"dist/*"
|
|
14
|
+
"dist/*",
|
|
15
|
+
"index.d.ts"
|
|
15
16
|
],
|
|
16
17
|
"sideEffects": false,
|
|
17
18
|
"scripts": {
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=14.15.0"
|
|
51
52
|
},
|
|
52
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "813d70df543ad8c8fc6acb881dff27f7eee59756"
|
|
53
54
|
}
|