From 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 四月 2026 11:46:41 +0800
Subject: [PATCH] 推送
---
node_modules/enhanced-resolve/types.d.ts | 106 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 98 insertions(+), 8 deletions(-)
diff --git a/node_modules/enhanced-resolve/types.d.ts b/node_modules/enhanced-resolve/types.d.ts
index 6953b2c..a56cc0c 100644
--- a/node_modules/enhanced-resolve/types.d.ts
+++ b/node_modules/enhanced-resolve/types.d.ts
@@ -34,7 +34,7 @@
/**
* content
*/
- context?: object;
+ context?: Context;
/**
* description file path
@@ -50,6 +50,11 @@
* description file data
*/
descriptionFileData?: JsonObject;
+
+ /**
+ * tsconfig paths map
+ */
+ tsconfigPathsMap?: null | TsconfigPathsMap;
/**
* relative path
@@ -160,6 +165,7 @@
>;
apply(resolver: Resolver): void;
}
+type Context = KnownContext & Record<any, any>;
declare interface Dirent<T extends string | Buffer = string> {
/**
* true when is file, otherwise false
@@ -553,6 +559,12 @@
| JsonValue[];
}
type JsonValue = null | string | number | boolean | JsonObject | JsonValue[];
+declare interface KnownContext {
+ /**
+ * environments
+ */
+ environments?: string[];
+}
declare interface KnownHooks {
/**
* resolve step hook
@@ -1081,12 +1093,12 @@
yield?: (request: ResolveRequest) => void;
}
declare interface ResolveFunction {
- (context: object, path: string, request: string): string | false;
+ (context: Context, path: string, request: string): string | false;
(path: string, request: string): string | false;
}
declare interface ResolveFunctionAsync {
(
- context: object,
+ context: Context,
path: string,
request: string,
resolveContext: ResolveContext,
@@ -1097,7 +1109,7 @@
) => void,
): void;
(
- context: object,
+ context: Context,
path: string,
request: string,
callback: (
@@ -1266,6 +1278,11 @@
* prefer absolute
*/
preferAbsolute: boolean;
+
+ /**
+ * tsconfig file path or config object
+ */
+ tsconfig: string | boolean | TsconfigOptions;
}
declare interface ResolveOptionsResolverFactoryObject_2 {
/**
@@ -1411,6 +1428,11 @@
* Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
*/
preferAbsolute?: boolean;
+
+ /**
+ * TypeScript config file path or config object with configFile and references
+ */
+ tsconfig?: string | boolean | TsconfigOptions;
}
type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
declare abstract class Resolver {
@@ -1439,9 +1461,9 @@
[ResolveRequest, ResolveContext],
null | ResolveRequest
>;
- resolveSync(context: object, path: string, request: string): string | false;
+ resolveSync(context: Context, path: string, request: string): string | false;
resolve(
- context: object,
+ context: Context,
path: string,
request: string,
resolveContext: ResolveContext,
@@ -1569,12 +1591,78 @@
*/
realpathSync?: RealPathSync;
}
+declare interface TsconfigOptions {
+ /**
+ * A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file
+ */
+ configFile?: string;
+
+ /**
+ * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths
+ */
+ references?: string[] | "auto";
+
+ /**
+ * Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file
+ */
+ baseUrl?: string;
+}
+declare interface TsconfigPathsData {
+ /**
+ * tsconfig file data
+ */
+ alias: AliasOption[];
+
+ /**
+ * tsconfig file data
+ */
+ modules: string[];
+}
+declare interface TsconfigPathsMap {
+ /**
+ * main tsconfig paths data
+ */
+ main: TsconfigPathsData;
+
+ /**
+ * main tsconfig base URL (absolute path)
+ */
+ mainContext: string;
+
+ /**
+ * referenced tsconfig paths data mapped by baseUrl
+ */
+ refs: { [index: string]: TsconfigPathsData };
+
+ /**
+ * all contexts (main + refs) for quick lookup
+ */
+ allContexts: { [index: string]: TsconfigPathsData };
+
+ /**
+ * file dependencies
+ */
+ fileDependencies: Set<string>;
+}
+declare class TsconfigPathsPlugin {
+ constructor(configFileOrOptions: string | true | TsconfigOptions);
+ configFile: string;
+ references: "auto" | TsconfigReference[];
+ baseUrl?: string;
+ apply(resolver: Resolver): void;
+}
+declare interface TsconfigReference {
+ /**
+ * Path to the referenced project
+ */
+ path: string;
+}
declare interface URL_url extends URL_Import {}
declare interface WriteOnlySet<T> {
add: (item: T) => void;
}
declare function exports(
- context: object,
+ context: Context,
path: string,
request: string,
resolveContext: ResolveContext,
@@ -1585,7 +1673,7 @@
) => void,
): void;
declare function exports(
- context: object,
+ context: Context,
path: string,
request: string,
callback: (
@@ -1640,10 +1728,12 @@
CachedInputFileSystem,
CloneBasenamePlugin,
LogInfoPlugin,
+ TsconfigPathsPlugin,
ResolveOptionsOptionalFS,
BaseFileSystem,
PnpApi,
Resolver,
+ Context,
FileSystem,
ResolveContext,
ResolveRequest,
--
Gitblit v1.9.3