1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | import { Url } from 'url';
|
16 | import { FileRelativeUrl, PackageRelativeUrl, ScannedImport } from '../index';
|
17 | import { ResolvedUrl } from '../model/url';
|
18 | import { UrlResolver } from './url-resolver';
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export declare class FsUrlResolver extends UrlResolver {
|
29 | private readonly host?;
|
30 | protected readonly protocol: string;
|
31 | protected readonly packageDir: string;
|
32 | protected readonly packageUrl: ResolvedUrl;
|
33 | constructor(packageDir: string | undefined, host?: string | undefined, protocol?: string);
|
34 | resolve(firstHref: ResolvedUrl | PackageRelativeUrl, secondHref?: FileRelativeUrl, _import?: ScannedImport): ResolvedUrl | undefined;
|
35 | protected shouldHandleAsFileUrl(url: Url): boolean;
|
36 | /**
|
37 | * Take the given URL which is either a file:// url or a url with the
|
38 | * configured hostname, and treat its pathname as though it points to a file
|
39 | * on the local filesystem, producing a file:/// url.
|
40 | *
|
41 | * Also corrects sibling URLs like `../foo` to point to
|
42 | * `./${component_dir}/foo`
|
43 | */
|
44 | private handleFileUrl;
|
45 | /**
|
46 | * Overridable method, for subclasses that want to redirect some filesystem
|
47 | * paths.
|
48 | *
|
49 | * @param fsPath An absolute path on the file system. Note that it will be
|
50 | * OS-specific.
|
51 | * @return An absolute path on the file system that we should resolve to.
|
52 | */
|
53 | protected modifyFsPath(fsPath: string): string;
|
54 | relative(to: ResolvedUrl): PackageRelativeUrl;
|
55 | relative(from: ResolvedUrl, to: ResolvedUrl, _kind?: string): FileRelativeUrl;
|
56 | protected filesystemPathForPathname(decodedPathname: string): string;
|
57 | }
|
58 |
|
\ | No newline at end of file |