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