UNPKG

eyeglass

Version:
88 lines 3.02 kB
import { SassImplementation } from "./SassImplementation"; /** * Provides an interface for working with URIs * * @constructor * @param {String} uri - the original URI * @param {String} sep - the target separator to use when representing the pathname */ export declare class URI { sep: "/" | "\\"; path: string; search: string; hash: string; constructor(uri: string, sep?: "/" | "\\" | null); /** * sets the new pathname for the URI * @param {String} pathname - the new pathname to set */ setPath(pathname: string): void; /** * gets the pathname of the URI * @param sep - the separator to use to represent the pathname * @param relativeTo - if set, returns the pathname relative to this base path */ getPath(sep?: string, relativeTo?: string): string; /** * adds a query string to the URI * @param {String} search - the query string to append */ addQuery(search: string): void; /** * replaces the query string on the URI * @param {String} search - the query string to set */ setQuery(search: string): void; /** * replaces the hash string on the URI * @param {String} hash - the hash string to set */ setHash(hash: string): void; /** * returns the URI as a string * @returns {String} the full URI */ toString(): string; /** * given any number of path fragments, joins the non-empty fragments * @returns {String} the joined fragments */ static join(...fragments: Array<string | undefined | null>): string; /** * whether or not a given URI is relative * @param {String} uri - the URI to check * @returns {Boolean} whether or not the URI is relative like */ static isRelative(uri: string): boolean; /** * normalizes the URI for use as a web URI * @param {String} uri - the URI to normalize * @returns {String} the normalized URI */ static web(uri: string): string; /** * normalizes the URI for use as a system path * @param {String} uri - the URI to normalize * @returns {String} the normalized URI */ static system(uri: string): string; /** * ensures that the URI is able to be cleanly exported to a SassString * @param {String} uri - the URI to normalize * @returns {String} the normalized URI */ static sass(sassImpl: SassImplementation, uri: string): string; /** * decorates a URI to preserve special characters * @param {String} uri - the URI to decorate * @returns {String} the decorated URI */ static preserve(uri: string): string; /** * restores a URI to restore special characters (opposite of URI.preserve) * @param {String} uri - the URI to restore * @returns {String} the restored URI */ static restore(uri: string): string; } //# sourceMappingURL=URI.d.ts.map