@rspress/core 1.41.1 → 1.41.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/193.js +12 -0
- package/dist/index.d.ts +39 -31
- package/dist/index.js +1701 -2167
- package/dist/loader.d.ts +78 -70
- package/dist/loader.js +544 -682
- package/dist/runtime/App.js +106 -132
- package/dist/runtime/clientEntry.js +71 -54
- package/dist/runtime/ssrEntry.js +30 -19
- package/dist/runtime/tsconfig.js +4 -0
- package/package.json +15 -15
- package/src/runtime/App.tsx +5 -2
- package/dist/index.js.map +0 -1
- package/dist/loader.js.map +0 -1
- package/dist/runtime/tsconfig.json +0 -10
package/dist/loader.d.ts
CHANGED
|
@@ -1,70 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
import { DefaultThemeConfig } from '@rspress/shared';
|
|
2
|
+
import type { PageIndexInfo } from '@rspress/shared';
|
|
3
|
+
import type { RouteMeta } from '@rspress/shared';
|
|
4
|
+
import type { Rspack as Rspack_2 } from '@rsbuild/core';
|
|
5
|
+
import type { RspressPlugin } from '@rspress/shared';
|
|
6
|
+
import type { UserConfig } from '@rspress/shared';
|
|
7
|
+
|
|
8
|
+
export declare function createCheckPageMetaUpdateFn(): (modulePath: string, pageMeta: PageMeta) => void;
|
|
9
|
+
|
|
10
|
+
declare interface LoaderOptions {
|
|
11
|
+
config: UserConfig;
|
|
12
|
+
docDirectory: string;
|
|
13
|
+
checkDeadLinks: boolean;
|
|
14
|
+
routeService: RouteService;
|
|
15
|
+
pluginDriver: PluginDriver;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare function mdxLoader(this: Rspack_2.LoaderContext<LoaderOptions>, source: string): Promise<void>;
|
|
19
|
+
export default mdxLoader;
|
|
20
|
+
|
|
21
|
+
export declare interface PageMeta {
|
|
22
|
+
toc: TocItem[];
|
|
23
|
+
title: string;
|
|
24
|
+
headingTitle: string;
|
|
25
|
+
frontmatter?: Record<string, any>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class PluginDriver {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(config: UserConfig, isProd: boolean);
|
|
31
|
+
init(): Promise<void>;
|
|
32
|
+
addPlugin(plugin: RspressPlugin): void;
|
|
33
|
+
getPlugins(): RspressPlugin[];
|
|
34
|
+
clearPlugins(): void;
|
|
35
|
+
removePlugin(pluginName: string): void;
|
|
36
|
+
modifyConfig(): Promise<UserConfig<DefaultThemeConfig>>;
|
|
37
|
+
beforeBuild(): Promise<any>;
|
|
38
|
+
afterBuild(): Promise<any>;
|
|
39
|
+
modifySearchIndexData(pages: PageIndexInfo[]): Promise<PageIndexInfo[]>;
|
|
40
|
+
extendPageData(pageData: PageIndexInfo): Promise<any>;
|
|
41
|
+
addPages(): Promise<any>;
|
|
42
|
+
routeGenerated(routes: RouteMeta[]): Promise<any>;
|
|
43
|
+
addRuntimeModules(): Promise<Record<string, string>>;
|
|
44
|
+
addSSGRoutes(): Promise<any>;
|
|
45
|
+
globalUIComponents(): (string | [string, object])[];
|
|
46
|
+
globalStyles(): string[];
|
|
47
|
+
_runParallelAsyncHook(hookName: string, ...args: unknown[]): Promise<any>;
|
|
48
|
+
_runSerialAsyncHook(hookName: string, ...args: unknown[]): Promise<any>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare class RouteService {
|
|
52
|
+
#private;
|
|
53
|
+
routeData: Map<string, RouteMeta>;
|
|
54
|
+
constructor(scanDir: string, userConfig: UserConfig, tempDir: string, pluginDriver: PluginDriver);
|
|
55
|
+
init(): Promise<void>;
|
|
56
|
+
addRoute(routeInfo: RouteMeta): void;
|
|
57
|
+
removeRoute(filePath: string): void;
|
|
58
|
+
getRoutes(): RouteMeta[];
|
|
59
|
+
isExistRoute(routePath: string): boolean;
|
|
60
|
+
isEmpty(): boolean;
|
|
61
|
+
generateRoutesCode(isStaticImport?: boolean): string;
|
|
62
|
+
generateRoutesCodeByRouteMeta(routeMeta: RouteMeta[], isStaticImport: boolean): string;
|
|
63
|
+
normalizeRoutePath(routePath: string): {
|
|
64
|
+
routePath: string;
|
|
65
|
+
lang: string;
|
|
66
|
+
version: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare interface TocItem {
|
|
71
|
+
id: string;
|
|
72
|
+
text: string;
|
|
73
|
+
depth: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export declare function updateSiteDataRuntimeModule(modulePath: string, pageMeta: PageMeta): Promise<void>;
|
|
77
|
+
|
|
78
|
+
export { }
|