UNPKG

2.66 kBTypeScriptView Raw
1import { URI as Uri } from 'vscode-uri';
2import { Path } from './path';
3export declare class URI {
4 static fromComponents(components: UriComponents): URI;
5 static fromComponents(components: undefined): undefined;
6 static fromFilePath(path: string): URI;
7 private readonly codeUri;
8 private _path;
9 constructor(uri?: string | Uri);
10 /**
11 * TODO move implementation to `DefaultUriLabelProviderContribution.getName`
12 *
13 * @deprecated use `LabelProvider.getName` instead
14 */
15 get displayName(): string;
16 /**
17 * Return all uri from the current to the top most.
18 */
19 get allLocations(): URI[];
20 get parent(): URI;
21 relative(uri: URI): Path | undefined;
22 resolve(path: string | Path): URI;
23 /**
24 * @returns a new, absolute URI if one can be computed from the path segments passed in.
25 */
26 resolveToAbsolute(...pathSegments: Array<string | Path>): URI | undefined;
27 /**
28 * return a new URI replacing the current with the given scheme
29 */
30 withScheme(scheme: string): URI;
31 /**
32 * return a new URI replacing the current with the given authority
33 */
34 withAuthority(authority: string): URI;
35 /**
36 * return this URI without a authority
37 */
38 withoutAuthority(): URI;
39 /**
40 * return a new URI replacing the current with the given path
41 */
42 withPath(path: string | Path): URI;
43 /**
44 * return this URI without a path
45 */
46 withoutPath(): URI;
47 /**
48 * return a new URI replacing the current with the given query
49 */
50 withQuery(query: string): URI;
51 /**
52 * return this URI without a query
53 */
54 withoutQuery(): URI;
55 /**
56 * return a new URI replacing the current with the given fragment
57 */
58 withFragment(fragment: string): URI;
59 /**
60 * return this URI without a fragment
61 */
62 withoutFragment(): URI;
63 /**
64 * return a new URI replacing the current with its normalized path, resolving '..' and '.' segments
65 */
66 normalizePath(): URI;
67 get scheme(): string;
68 get authority(): string;
69 get path(): Path;
70 get query(): string;
71 get fragment(): string;
72 toString(skipEncoding?: boolean): string;
73 isEqual(uri: URI, caseSensitive?: boolean): boolean;
74 isEqualOrParent(uri: URI, caseSensitive?: boolean): boolean;
75 static getDistinctParents(uris: URI[]): URI[];
76 private hasSameOrigin;
77 toComponents(): UriComponents;
78}
79export interface UriComponents {
80 scheme: string;
81 authority: string;
82 path: string;
83 query: string;
84 fragment: string;
85 external?: string;
86}
87export default URI;
88//# sourceMappingURL=uri.d.ts.map
\No newline at end of file