import { type RedirectPathParseError } from './redirectPaths';
declare const __brand: unique symbol;
type Brand<T, B extends string> = T & {
    readonly [__brand]: B;
};
/**
 * A redirect path that has been validated as a safe, same-origin relative path.
 *
 * Parse once at the boundary, then carry the branded value inward instead of
 * re-validating ad hoc string inputs in every auth flow.
 */
export type SafeAppPath = Brand<string, 'SafeAppPath'>;
export type SafeAppPathParseError = RedirectPathParseError;
export type SafeAppPathParseResult = {
    ok: true;
    value: SafeAppPath;
} | {
    ok: false;
    error: SafeAppPathParseError;
};
export declare function parseSafeAppPath(value: unknown): SafeAppPathParseResult;
export declare function sanitizeSafeAppPath(value: unknown): SafeAppPath | null;
export declare function assertSafeAppPath(value: string): SafeAppPath;
export declare function safeAppPathOrFallback(value: unknown, fallback: SafeAppPath): SafeAppPath;
export declare function buildSafeRedirectUrl(path: SafeAppPath, baseUrl: string | URL): URL;
export {};
