@wireapp/commons
Version:
Collection of common components that are used across Wire web applications.
28 lines • 1.84 kB
TypeScript
export declare function pathWithParams(path: string, additionalParams?: Record<string, any>, whitelistParams?: string[], search?: string): string;
export declare function paramsToRecord(params: string): Record<string, any>;
/**
* Looks for a given parameter by name in the query part of the URL of the current window's location.
* @param parameterName the name of the parameter to search for
* @param search the source to look at for the parameter, defaults to window.location.search
* @returns the first found parameter or an empty string
*/
export declare function getURLParameter(parameterName: string, search?: string): string;
/**
* Looks for a given parameter by name in the hash part of the URL of the current window's location.
* @param parameterName the name of the parameter to search for
* @param hash the source to look for at the parameter, defaults to window.location.hash
* @returns the first found parameter or an empty string
*/
export declare function getURLParameterFromHash(parameterName: string, hash?: string): string;
/**
* Looks for a given parameter by name in the hash and query part of the URL of the current window's location.
* Findings in the hash part are preferend ver the query part.
* Empty values are considered a valid value.
* @param parameterName the name of the parameter to search for
* @param hash the "hash" source to look for at the parameter, defaults to window.location.hash
* @param search the "search" source to look at for the parameter, defaults to window.location.search
* @returns the first found parameter or an empty string
*/
export declare function getURLParameterFromAny(parameterName: string, hash?: string, search?: string): string;
export declare function hasURLParameter(parameterName: string, search?: string): boolean;
//# sourceMappingURL=UrlUtil.d.ts.map