@moneko/react 1.4.3 → 1.4.5

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/env.d.ts CHANGED
@@ -133,16 +133,29 @@ declare module '@app/routes' {
133
133
 
134
134
  export default routes;
135
135
  }
136
+
137
+ interface ExampleModuleBase {
138
+ codes: Record<string, string>;
139
+ title?: string;
140
+ description?: string;
141
+ col?: string;
142
+ order?: number;
143
+ [key: string]: unknown;
144
+ }
145
+
136
146
  declare module '@app/example' {
137
- export interface ExampleModule {
138
- codes: Record<string, string>;
139
- title?: string;
140
- description?: string;
141
- col?: string;
142
- order?: number;
147
+ export interface ExampleModule extends ExampleModuleBase {
148
+ [key: string]: unknown;
149
+ }
150
+ const examples: Record<string, () => Promise<{ default: ExampleModule[] }>>;
151
+
152
+ export default examples;
153
+ }
154
+ declare module '@app/example/*' {
155
+ export interface ExampleModule extends ExampleModuleBase {
143
156
  [key: string]: unknown;
144
157
  }
145
- const example: Record<string, ExampleModule[]>;
158
+ const example: ExampleModule[];
146
159
 
147
160
  export default example;
148
161
  }
package/lib/entry.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ type RenderAppProps = {
3
+ container?: HTMLElement;
4
+ basename?: string;
5
+ fallback?: React.ReactElement;
6
+ language?: string;
7
+ };
8
+ export declare function App(props: RenderAppProps): React.JSX.Element;
9
+ declare function renderApp(props?: RenderAppProps): () => void;
10
+ export default renderApp;
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from 'react-router-dom';
2
+ export { default as LinkWithMenuId } from './link.js';
3
+ export { default as useNavigateWithMenuId } from './use-navgate.js';
package/lib/link.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import { type LinkProps as ReactRouterLinkProps, type To } from 'react-router-dom';
3
+ export interface LinkProps extends Omit<ReactRouterLinkProps, 'to'> {
4
+ /** 保留字 */
5
+ reserved?: string | string[];
6
+ to: To | -1;
7
+ }
8
+ /** 跳转时继承部分query参数
9
+ * @default {string[]} ['menuId', 'dynamicTitle']
10
+ */
11
+ declare const Link: FC<LinkProps>;
12
+ export default Link;
@@ -0,0 +1 @@
1
+ export declare const injectRemoteReactRefresh: () => void;
@@ -0,0 +1,6 @@
1
+ import { type NavigateOptions, type To } from 'react-router-dom';
2
+ /** 跳转时继承部分query参数
3
+ * @default {string[]} ['menuId', 'dynamicTitle']
4
+ */
5
+ declare const useNavigate: (reserved?: string | string[]) => (to: To | -1, options?: NavigateOptions) => void;
6
+ export default useNavigate;
package/mdx.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface MDXComponents {
3
+ [k: string]: (props: Record<string, any>) => JSX.Element;
4
+ }
5
+ export interface MDXProviderProps extends React.Component {
6
+ children: JSX.Element;
7
+ components: MDXComponents | ((props: Record<string, any>) => MDXComponents);
8
+ disableParentContext?: boolean;
9
+ }
10
+ export declare function useMDXComponents(components: MDXComponents | ((props: Record<string, any>) => MDXComponents)): MDXComponents;
11
+ export declare function MDXProvider(props: MDXProviderProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/react",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -13,22 +13,22 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
16
- "react-refresh": "0.14.0",
16
+ "react-refresh": "0.14.1",
17
17
  "react-refresh-typescript": "2.0.9",
18
- "react-router": "6.22.3",
19
- "react-router-dom": "6.22.3",
18
+ "react-router": "6.23.0",
19
+ "react-router-dom": "6.23.0",
20
20
  "shared-store-object": "1.1.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@moneko/transform-imports": "0.4.0",
23
+ "@moneko/transform-imports": "0.5.1",
24
24
  "@swc/cli": "0.3.12",
25
- "@swc/core": "1.4.12",
26
- "@types/react": "18.2.74",
27
- "@types/react-dom": "18.2.24",
28
- "eslint-config-neko": "2.6.0",
29
- "react": "18.2.0",
30
- "react-dom": "18.2.0",
31
- "typescript": "5.4.4"
25
+ "@swc/core": "1.5.0",
26
+ "@types/react": "18.3.0",
27
+ "@types/react-dom": "18.3.0",
28
+ "eslint-config-neko": "2.7.1",
29
+ "react": "18.3.0",
30
+ "react-dom": "18.3.0",
31
+ "typescript": "5.4.5"
32
32
  },
33
33
  "files": [
34
34
  "lib",