export declare class PathHelper { static trimSlashes(path: string): string; /** Empty / whitespace-only segments are filtered out. */ static getSegments(path: string): string[]; /** Joins paths, collapsing duplicate and missing slashes between segments. */ static joinPaths(...args: string[]): string; static isAncestorOf(ancestorPath: string, descendantPath: string): boolean; /** * Returns the parent path. Single-segment paths return themselves * (e.g. `'Root'` → `'Root'`). */ static getParentPath(path: string): string; static normalize(path: string): string; /** * @example * PathHelper.trimTrailingSlash('/api/') // '/api' * PathHelper.trimTrailingSlash('http://example.com/') // 'http://example.com' */ static trimTrailingSlash(url: string): string; /** * @example * PathHelper.trimLeadingSlash('/api') // 'api' * PathHelper.trimLeadingSlash('api') // 'api' */ static trimLeadingSlash(path: string): string; /** * @example * PathHelper.ensureLeadingSlash('api') // '/api' * PathHelper.ensureLeadingSlash('/api') // '/api' */ static ensureLeadingSlash(path: string): string; /** Strips trailing slash from a base URL. Idempotent. */ static normalizeBaseUrl(baseUrl: string): string; /** * Joins a base URL with a path, collapsing slashes. Preserves protocols * (`http://`, `https://`, …). * * @example * PathHelper.joinUrl('http://example.com', '/path') // 'http://example.com/path' * PathHelper.joinUrl('/api/', 'users') // '/api/users' * PathHelper.joinUrl('http://example.com', '') // 'http://example.com' */ static joinUrl(baseUrl: string, path: string): string; /** * Boundary-aware prefix match — `/api2` does not match `/api`. Trailing * slashes on `baseUrl` are tolerated. * * @example * PathHelper.matchesBaseUrl('/api/users', '/api') // true * PathHelper.matchesBaseUrl('/api2', '/api') // false (not a path match) */ static matchesBaseUrl(requestUrl: string, baseUrl: string): boolean; /** * Returns the path remainder after stripping `baseUrl`. Exact matches * return `''`. When `requestUrl` does not match `baseUrl`, returns * `requestUrl` unchanged. * * @example * PathHelper.extractPath('/api/users', '/api') // '/users' * PathHelper.extractPath('/api', '/api') // '' * PathHelper.extractPath('/api/users?id=1', '/api') // '/users?id=1' */ static extractPath(requestUrl: string, baseUrl: string): string; /** * Collapses consecutive slashes. The `://` after a protocol is preserved. * * @example * PathHelper.normalizeUrl('http://example.com//path') // 'http://example.com/path' * PathHelper.normalizeUrl('/api//users///123') // '/api/users/123' */ static normalizeUrl(url: string): string; } //# sourceMappingURL=path-helper.d.ts.map