1 |
|
2 | import * as TsconfigPaths from "tsconfig-paths";
|
3 | import * as Options from "./options";
|
4 | import * as Logger from "./logger";
|
5 | import * as fs from "fs";
|
6 | import { ResolvePluginInstance, Resolver } from "webpack";
|
7 | import { ResolveRequest, ResolveContext } from "enhanced-resolve";
|
8 | declare type TapAsyncCallback = (request: ResolveRequest, context: ResolveContext, callback: TapAsyncInnerCallback) => void;
|
9 | declare type TapAsyncInnerCallback = (error?: Error | null | false, result?: null | ResolveRequest) => void;
|
10 | export interface LegacyResolverPlugin {
|
11 | readonly apply: (resolver: LegacyResolver) => void;
|
12 | }
|
13 | export interface LegacyResolver {
|
14 | readonly apply: (plugin: LegacyResolverPlugin) => void;
|
15 | readonly plugin: (source: string, cb: ResolverCallbackLegacy) => void;
|
16 | readonly doResolve: doResolveLegacy | doResolve;
|
17 | readonly join: (relativePath: string, innerRequest: Request) => Request;
|
18 | readonly fileSystem: LegacyResolverFileSystem;
|
19 | readonly getHook: (hook: string) => Tapable;
|
20 | }
|
21 | export declare type doResolveLegacy = (target: string, req: Request, desc: string, callback: Callback) => void;
|
22 | export declare type doResolve = (hook: Tapable, req: Request, message: string, resolveContext: LegacyResolveContext, callback: Callback) => void;
|
23 | export declare type ReadJsonCallback = (error: Error | undefined, result?: {}) => void;
|
24 | export declare type ReadJson = (path2: string, callback: ReadJsonCallback) => void;
|
25 | export declare type LegacyResolverFileSystem = typeof fs & {
|
26 | readJson?: ReadJson;
|
27 | };
|
28 | export interface LegacyResolveContext {
|
29 | log?: string;
|
30 | stack?: string;
|
31 | missing?: string;
|
32 | }
|
33 | export interface Tapable {
|
34 | readonly tapAsync: (options: TapableOptions, callback: TapAsyncCallback) => void;
|
35 | }
|
36 | export interface TapableOptions {
|
37 | readonly name: string;
|
38 | }
|
39 | export declare type ResolverCallbackLegacy = (request: Request, callback: Callback) => void;
|
40 | export declare type ResolverCallback = (request: Request, resolveContext: LegacyResolveContext, callback: Callback) => void;
|
41 | export interface Request {
|
42 | readonly request?: Request | string;
|
43 | readonly relativePath: string;
|
44 | readonly path: string;
|
45 | readonly context: {
|
46 | readonly issuer: string;
|
47 | };
|
48 | }
|
49 | export interface Callback {
|
50 | (err?: Error, result?: string): void;
|
51 | log?: string;
|
52 | stack?: string;
|
53 | missing?: string;
|
54 | }
|
55 | export declare class TsconfigPathsPlugin implements ResolvePluginInstance {
|
56 | source: string;
|
57 | target: string;
|
58 | log: Logger.Logger;
|
59 | baseUrl: string | undefined;
|
60 | absoluteBaseUrl: string;
|
61 | extensions: ReadonlyArray<string>;
|
62 | referenceMatchMap: Record<string, TsconfigPaths.MatchPathAsync>;
|
63 | matchPath: TsconfigPaths.MatchPathAsync;
|
64 | constructor(rawOptions?: Partial<Options.Options>);
|
65 | apply(resolver: Resolver): void;
|
66 | }
|
67 | export {};
|