import type { WorkspaceFolder, WorkspaceConfiguration } from "$/ai-utils";
import type { DevToolsPath, DevToolsSys } from "../../types";
export interface ResolveWorkspacePathOptions {
    filePath: string;
    forceWorkspace?: boolean;
    workspace?: WorkspaceConfiguration;
    workingDirectory: string;
    sys: DevToolsSys;
    canCollapseWorkspace?: boolean;
}
export interface ResolveWorkspacePathResult {
    resolvedPath: string;
    workspaceFolder?: WorkspaceFolder;
}
/**
 * Resolves a workspace file path to its actual file system path.
 *
 * This function handles various workspace configurations:
 * - Single workspace named "." (treats paths as direct relative paths)
 * - Multiple workspaces (matches path prefixes to workspace names/folder names)
 * - No workspace configuration (falls back to working directory)
 *
 * @param options Configuration object containing all required parameters
 * @param options.filePath A file path that may include a workspace prefix (e.g., "workspace1/path/to/file.js")
 * @param options.forceWorkspace If true, will try the first workspace as fallback when no workspace folder is found
 * @param options.workspace Optional workspace configuration with folders
 * @param options.workingDirectory The base working directory to resolve paths against
 * @param options.sys DevToolsSys object providing path resolution functions
 * @returns Object containing the resolved file system path and matched workspace folder
 *
 * @example
 * ```typescript
 * import { createNodeSys } from '@builder.io/dev-tools/node';
 *
 * const result = resolveWorkspacePath({
 *   filePath: 'frontend/src/components/Button.tsx',
 *   workingDirectory: '/home/user/project',
 *   sys: createNodeSys(),
 *   workspace: {
 *     folders: [
 *       { name: 'frontend', path: './packages/frontend' },
 *       { name: 'backend', path: './packages/backend' }
 *     ]
 *   }
 * });
 * // Returns: {
 * //   resolvedPath: '/home/user/project/packages/frontend/src/components/Button.tsx',
 * //   workspaceFolder: { name: 'frontend', path: './packages/frontend' }
 * // }
 * ```
 */
export declare function resolveWorkspacePath(options: ResolveWorkspacePathOptions): ResolveWorkspacePathResult;
export interface AbsolutePathToWorkspaceUrlOptions {
    absolutePath: string;
    workspace?: WorkspaceConfiguration;
    workingDirectory: string;
    sys: DevToolsSys;
    canCollapseWorkspace?: boolean;
}
/**
 * Converts an absolute file system path to a workspace URL if possible.
 *
 * This function is the inverse of `resolveWorkspacePath`. It takes an absolute path
 * and attempts to convert it back to a workspace-relative path (e.g., "frontend/src/file.ts").
 *
 * @param options Configuration object containing all required parameters
 * @param options.absolutePath The absolute file system path to convert
 * @param options.workspace Optional workspace configuration with folders
 * @param options.workingDirectory The base working directory
 * @param options.sys DevToolsSys object providing path resolution functions
 * @param options.canCollapseWorkspace If true, handles collapsible workspace scenarios
 * @returns The workspace URL if the path can be converted, undefined otherwise
 *
 * @example
 * ```typescript
 * import { createNodeSys } from '@builder.io/dev-tools/node';
 *
 * const workspaceUrl = absolutePathToWorkspaceUrl({
 *   absolutePath: '/home/user/project/packages/frontend/src/components/Button.tsx',
 *   workingDirectory: '/home/user/project',
 *   sys: createNodeSys(),
 *   workspace: {
 *     folders: [
 *       { name: 'frontend', path: './packages/frontend' },
 *       { name: 'backend', path: './packages/backend' }
 *     ]
 *   }
 * });
 * // Returns: 'frontend/src/components/Button.tsx'
 * ```
 */
export declare function absolutePathToWorkspaceUrl(options: AbsolutePathToWorkspaceUrlOptions): string | undefined;
export interface IsPathInsideWorkspaceOptions {
    resolvedPath: string;
    workingDirectory: string;
    workspace?: WorkspaceConfiguration;
    sys: DevToolsPath;
}
/**
 * Checks whether `resolvedPath` is inside the working directory or any
 * configured workspace folder.  Uses `startsWith(base + sep)` (plus an
 * exact-match check) to avoid prefix false-positives like `/work` matching
 * `/workspace`.
 */
export declare function isPathInsideWorkspace(options: IsPathInsideWorkspaceOptions): boolean;
