1 | import type { Plugin, PluginHooks } from 'rollup';
|
2 |
|
3 | type MapToFunction<T> = T extends Function ? T : never;
|
4 |
|
5 | export type ResolverFunction = MapToFunction<PluginHooks['resolveId']>;
|
6 |
|
7 | export interface ResolverObject {
|
8 | buildStart?: PluginHooks['buildStart'];
|
9 | resolveId: ResolverFunction;
|
10 | }
|
11 |
|
12 | export interface Alias {
|
13 | find: string | RegExp;
|
14 | replacement: string;
|
15 | customResolver?: ResolverFunction | ResolverObject | null;
|
16 | }
|
17 |
|
18 | export interface ResolvedAlias {
|
19 | find: string | RegExp;
|
20 | replacement: string;
|
21 | resolverFunction: ResolverFunction | null;
|
22 | }
|
23 |
|
24 | export interface RollupAliasOptions {
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | customResolver?: ResolverFunction | ResolverObject | null;
|
31 |
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | entries?: readonly Alias[] | { [find: string]: string };
|
39 | }
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | export default function alias(options?: RollupAliasOptions): Plugin;
|