1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { CompilerOptions } from 'typescript';
|
9 | import type { Resolver } from 'webpack';
|
10 | export interface TypeScriptPathsPluginOptions extends Pick<CompilerOptions, 'paths' | 'baseUrl'> {
|
11 | }
|
12 | type ResolverRequest = NonNullable<Parameters<Parameters<Resolver['resolve']>[4]>[2]>;
|
13 | interface PathPluginResolverRequest extends ResolverRequest {
|
14 | context?: {
|
15 | issuer?: string;
|
16 | };
|
17 | typescriptPathMapped?: boolean;
|
18 | }
|
19 | export declare class TypeScriptPathsPlugin {
|
20 | private baseUrl?;
|
21 | private patterns?;
|
22 | constructor(options?: TypeScriptPathsPluginOptions);
|
23 | /**
|
24 | * Update the plugin with new path mapping option values.
|
25 | * The options will also be preprocessed to reduce the overhead of individual resolve actions
|
26 | * during a build.
|
27 | *
|
28 | * @param options The `paths` and `baseUrl` options from TypeScript's `CompilerOptions`.
|
29 | */
|
30 | update(options: TypeScriptPathsPluginOptions): void;
|
31 | apply(resolver: Resolver): void;
|
32 | findReplacements(originalRequest: string): IterableIterator<string>;
|
33 | createReplacementRequests(request: PathPluginResolverRequest, originalRequest: string): IterableIterator<PathPluginResolverRequest>;
|
34 | }
|
35 | export {};
|