@modern-js/types 2.27.0 → 2.28.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 2.28.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 4e3ce96: fix: fix type for NestedRoute
8
+ fix: 修复 NestedRoute 的类型
9
+
3
10
  ## 2.27.0
4
11
 
5
12
  ## 2.26.0
package/cli/index.d.ts CHANGED
@@ -50,18 +50,20 @@ export type Route = Partial<{
50
50
  type: string;
51
51
  };
52
52
 
53
- export type NestedRoute = Merge<
53
+ export type NestedRouteForCli = NestedRoute<string>;
54
+
55
+ export type NestedRoute<T = string | (() => JSX.Element)> = Merge<
54
56
  Route,
55
57
  {
56
58
  type: 'nested';
57
59
  parentId?: string;
58
- children?: NestedRoute[];
60
+ children?: NestedRoute<T>[];
59
61
  filename?: string;
60
62
  _component?: string;
61
- component?: string;
63
+ component?: T;
62
64
  lazyImport?: () => Promise<any>;
63
- loading?: string;
64
- error?: string;
65
+ loading?: T;
66
+ error?: T;
65
67
  isRoot?: boolean;
66
68
  config?: string | Record<string, any>;
67
69
  }
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.27.0",
18
+ "version": "2.28.0",
19
19
  "types": "./index.d.ts",
20
20
  "exports": {
21
21
  ".": {
@@ -45,8 +45,8 @@
45
45
  "http-proxy-middleware": "^2.0.4",
46
46
  "jest": "^29",
47
47
  "type-fest": "2.15.0",
48
- "@scripts/jest-config": "2.27.0",
49
- "@scripts/build": "2.27.0"
48
+ "@scripts/build": "2.28.0",
49
+ "@scripts/jest-config": "2.28.0"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "publishConfig": {