@native-router/core 1.0.2 → 1.0.3
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/dist/types/types.d.ts +0 -30
- package/package.json +1 -11
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Path, MatchResult } from 'path-to-regexp';
|
|
2
2
|
import type { History, Path as HPath } from 'history';
|
|
3
|
-
import type { AnchorHTMLAttributes, ComponentType, Context as ReactContext, DetailedHTMLProps, ReactNode } from 'react';
|
|
4
3
|
export type Location<T = any> = HPath & {
|
|
5
4
|
state?: T;
|
|
6
5
|
};
|
|
@@ -43,32 +42,3 @@ export type RouterInstance<R extends BaseRoute, V = any> = {
|
|
|
43
42
|
cancelAll(): void;
|
|
44
43
|
resolving?: Location;
|
|
45
44
|
} & RequiredOf<Options<V>, 'baseUrl'>;
|
|
46
|
-
export type Context<T extends BaseRoute> = {
|
|
47
|
-
matched: Matched<T>[];
|
|
48
|
-
index: number;
|
|
49
|
-
router: RouterInstance<BaseRoute>;
|
|
50
|
-
location: Location;
|
|
51
|
-
params: Record<string, string>;
|
|
52
|
-
};
|
|
53
|
-
export type Route = BaseRoute<{
|
|
54
|
-
name?: string;
|
|
55
|
-
data?(ctx: Context<Route>): any | Promise<any>;
|
|
56
|
-
component?(ctx: Context<Route>): ComponentType | Promise<ComponentType | {
|
|
57
|
-
default: ComponentType;
|
|
58
|
-
}>;
|
|
59
|
-
}>;
|
|
60
|
-
export type StateContext<S> = {
|
|
61
|
-
SetterContext: ReactContext<((v: S) => void) | undefined>;
|
|
62
|
-
ValueContext: ReactContext<S | undefined>;
|
|
63
|
-
Provider: ComponentType<{
|
|
64
|
-
children: ReactNode;
|
|
65
|
-
}>;
|
|
66
|
-
};
|
|
67
|
-
export type LoadStatus = {
|
|
68
|
-
key: number;
|
|
69
|
-
status: 'pending' | 'resolved' | 'rejected';
|
|
70
|
-
};
|
|
71
|
-
export type LinkProps = {
|
|
72
|
-
to: string;
|
|
73
|
-
children?: ReactNode;
|
|
74
|
-
} & DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@native-router/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/index.mjs",
|
|
@@ -53,10 +53,6 @@
|
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=14"
|
|
55
55
|
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
58
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
59
|
-
},
|
|
60
56
|
"dependencies": {
|
|
61
57
|
"history": "^5.3.0",
|
|
62
58
|
"path-to-regexp": "^6.2.1"
|
|
@@ -64,7 +60,6 @@
|
|
|
64
60
|
"devDependencies": {
|
|
65
61
|
"@babel/core": "^7.22.9",
|
|
66
62
|
"@babel/preset-env": "^7.22.9",
|
|
67
|
-
"@babel/preset-react": "^7.22.5",
|
|
68
63
|
"@babel/preset-typescript": "^7.22.5",
|
|
69
64
|
"@babel/register": "^7.22.5",
|
|
70
65
|
"@linaria/babel-preset": "^4.5.4",
|
|
@@ -75,12 +70,9 @@
|
|
|
75
70
|
"@rollup/plugin-replace": "^5.0.2",
|
|
76
71
|
"@types/mocha": "^10.0.1",
|
|
77
72
|
"@types/node": "^20.4.5",
|
|
78
|
-
"@types/react": "^18.2.16",
|
|
79
|
-
"@types/react-dom": "^18.2.7",
|
|
80
73
|
"@types/sinon": "^10.0.15",
|
|
81
74
|
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
|
82
75
|
"@typescript-eslint/parser": "^6.2.0",
|
|
83
|
-
"@vitejs/plugin-react": "^4.0.3",
|
|
84
76
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
85
77
|
"commitizen": "^4.3.0",
|
|
86
78
|
"core-js": "^3.31.1",
|
|
@@ -106,8 +98,6 @@
|
|
|
106
98
|
"mocha": "^10.2.0",
|
|
107
99
|
"nyc": "^15.1.0",
|
|
108
100
|
"prettier": "^3.0.0",
|
|
109
|
-
"react": "^18.2.0",
|
|
110
|
-
"react-dom": "^18.2.0",
|
|
111
101
|
"rollup": "^3.28.0",
|
|
112
102
|
"should": "^13.2.3",
|
|
113
103
|
"should-sinon": "0.0.6",
|