/** * Normalizes a path by removing leading and trailing slashes. * * @param path - The path to normalize * @returns The normalized path without leading or trailing slashes * * @example * normalizePath('/foo/bar/') // 'foo/bar' * normalizePath('foo/bar') // 'foo/bar' * normalizePath('/foo/') // 'foo' */ export declare const normalizePath: (path: string) => string; /** * Returns path without query string and hash fragment. * * @param path - Full path (or URL-like string) * @returns Pathname only * * @example * getPathname('/create/source?section=secrets') // '/create/source' * getPathname('/create/source#panel') // '/create/source' * getPathname('/create/source?section=secrets#panel') // '/create/source' */ export declare const getPathname: (path: string) => string; /** * Parses query string into URLSearchParams. * * @param path - Full path (or URL-like string) * @returns Parsed query parameters. Empty when no query string exists. * * @example * getQueryParams('/create/source?section=secrets').get('section') // 'secrets' * getQueryParams('/create/source').get('section') // null */ export declare const getQueryParams: (path: string) => URLSearchParams; /** * Builds a path by combining pathname and query params. * * @param path - Base path (query/hash are ignored) * @param params - Query params to append * @returns Path with query string when params are present * * @example * buildPathWithQueryParams('/create/source', new URLSearchParams({ section: 'secrets' })) * // '/create/source?section=secrets' * buildPathWithQueryParams('/create/source?old=1', new URLSearchParams()) // '/create/source' */ export declare const buildPathWithQueryParams: (path: string, params: URLSearchParams) => string; /** * Sets or removes a single query parameter on a path. * * @param path - Base path (with or without query/hash) * @param key - Query parameter key * @param value - Query parameter value. If empty/undefined, key is removed. * @returns Updated path * * @example * setQueryParam('/create/source', 'section', 'configuration') * // '/create/source?section=configuration' * setQueryParam('/create/source?section=secrets', 'section', undefined) * // '/create/source' */ export declare const setQueryParam: (path: string, key: string, value?: string) => string; /** * Extracts a specific segment from a path after removing the base path prefix. * * @param currentPath - The full current path * @param basePath - The base path prefix to remove * @param segmentIndex - The index of the segment to extract (0-based) * @returns The segment at the specified index, or undefined if not found * * @example * getPathSegment('/pipeline/create/source', 'pipeline', 0) // 'create' * getPathSegment('/pipeline/create/source', 'pipeline', 1) // 'source' * getPathSegment('/pipeline/create/source', 'pipeline', 2) // undefined */ export declare const getPathSegment: (currentPath: string, basePath: string, segmentIndex: number) => string | undefined;