export type constructUrlWithRedirectProps = { signInUrl: string; signInPathParam?: string; currentPath: string; signUpUrl?: string; signUpPathParam?: string; }; interface BuildURLParams extends Partial { base?: string; hashPath?: string; hashSearch?: string; hashSearchParams?: URLSearchParams | Record | Array>; } interface BuildURLOptions { skipOrigin?: boolean; stringify?: T; } /** * * buildURL(params: URLParams, options: BuildURLOptions): string * * Builds a URL safely by using the native URL() constructor. It can * also build a secondary path and search URL that lives inside the hash * of the main URL. For example: * * https://foo.com/bar?qux=42#/hash-bar?hash-qux=42 * * References: * https://developer.mozilla.org/en-US/docs/Web/API/URL * * @param {BuildURLParams} params * @param {BuildURLOptions} options * @returns {URL | string} Returns the URL href */ export declare function buildURL(params: BuildURLParams, options?: BuildURLOptions): B extends true ? string : URL; /** * Constructs a full URL with the current origin * @param path - The path to construct the URL for * @returns The full URL with origin */ export declare const constructFullUrl: (path: string) => string; /** * Checks if the current URL has a redirect loop * @param currentPath - The current pathname * @param redirectPath - The path we're trying to redirect to * @returns boolean indicating if there's a redirect loop */ export declare const hasRedirectLoop: (currentPath: string, redirectPath: string) => boolean; export declare const urlWithRedirect: (options: constructUrlWithRedirectProps) => string; /** * Stores the current path before signing out */ export declare const storePreviousPath: (path: string) => void; /** * Gets the stored previous path */ export declare const getPreviousPath: () => string | null; /** * Gets a validated redirect URL ensuring it's from the same origin * @param redirectUrl - The URL to validate * @param searchParams - The search parameters to check for redirect * @returns A validated redirect URL */ export declare const getValidRedirectUrl: (searchParams: URLSearchParams, configuredRedirect?: string) => string; export declare function toURL(url: string | URL): URL; export {}; //# sourceMappingURL=construct.d.ts.map