/** The plain-data (JSON-safe) form of a {@link URI}. */ export interface URIComponents { scheme: string; authority: string; path: string; query: string; fragment: string; } export declare class URI { readonly scheme: string; readonly authority: string; readonly path: string; readonly query: string; readonly fragment: string; constructor(from?: Partial); /** * Parses a string value into a URI object. * @param value the string value of the URI * @param defaultScheme the default scheme to use if none is provided in the value. * - if a `string`, it will be used as the default scheme * - if a `URI`, its scheme will be used as the default scheme * - if `null`, no default scheme should be used (which forces `value` to have a scheme) * @returns the parsed URI object * @throws if no scheme is provided in value and no default scheme is given */ static parse(value: string, defaultScheme: URI | string | null): URI; /** * @deprecated Will not work with web extension. Use only for testing. * @param value the path to turn into a URI * @returns the file URI */ static file(value: string): URI; static placeholder(path: string): URI; resolve(value: string | URI, isDirectory?: boolean): URI; isAbsolute(): boolean; getDirectory(): URI; getBasename(): string; getName(): string; getExtension(): string; changeExtension(from: string, to: string): URI; joinPath(...paths: string[]): URI; relativeTo(uri: URI): URI; /** * Creates a new URI with the specified changes. * Note that this does not validate the resulting URI, e.g. you can * set the path to a relative path. * If you want to ensure that the path is properly formatted, use `forPath` instead. * * @param change an object that describes the desired changes to the URI. * @returns a new URI instance with the updated fields */ with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string; }): URI; /** * Creates a new URI with the specified path. * The difference between `with({ path })` and `forPath(path)` is that * this function will ensure that the path is properly formatted (e.g. starting with a `/`) * whereas `with` will take the path "as is". * * @param path the new path * @returns a new URI instance with the updated path */ forPath(path: string): URI; /** * Returns a URI without the fragment and query information */ asPlain(): URI; isPlaceholder(): boolean; toFsPath(): string; toString(): string; toJSON(): URIComponents; /** Reconstructs a URI instance from its {@link toJSON} plain-data form. */ static fromJSON(data: URIComponents): URI; isMarkdown(): boolean; isEqual(uri: URI): boolean; } /** * Turns a relative URI into an absolute URI given a collection of base folders. * In case of multiple matches it returns the first one. * * @see {@link pathUtils.asAbsolutePaths|path.asAbsolutePath} * * @param uri the uri to evaluate * @param baseFolders the base folders to use * @returns an absolute uri */ export declare function asAbsoluteUri(uriOrPath: URI | string, baseFolders: URI[]): URI; //# sourceMappingURL=uri.d.ts.map