import { type PackageManagerId } from '../shared/package-managers.js'; export declare const WORKSPACE_TEMPLATE_PACKAGE = "@wp-typia/create-workspace-template"; export interface WorkspacePackageJson { author?: string; name?: string; packageManager?: string; scripts?: Record; wpTypia?: { namespace?: string; phpPrefix?: string; projectType?: string; templatePackage?: string; textDomain?: string; }; } export interface WorkspaceProject { author: string; packageManager: PackageManagerId; packageName: string; projectDir: string; workspace: Required>; } /** * Parse a workspace package manifest from a project directory or `package.json` path. * * @param projectDirOrManifestPath Absolute or relative project directory, or a direct * path to `package.json`. * @returns The parsed workspace package manifest. * @throws {Error} When the manifest cannot be parsed. */ export declare function parseWorkspacePackageJson(projectDirOrManifestPath: string): WorkspacePackageJson; /** * Explain why a nearby wp-typia workspace cannot be resolved from `startDir`. * * @param startDir Directory to begin walking upward from. * @returns A human-readable validation error when a candidate workspace package * manifest is found but its `wpTypia` metadata is invalid, or `null` when no * invalid workspace candidate is discovered. * @throws {Error} When a discovered `package.json` cannot be parsed. */ export declare function getInvalidWorkspaceProjectReason(startDir: string): string | null; /** * Parse a package-manager identifier from a `packageManager` field. * * @param packageManagerField Raw package-manager field such as `bun@1.3.11`. * @returns A normalized `PackageManagerId`, defaulting to `"npm"` when the * field is missing or unsupported. */ export declare function parseWorkspacePackageManagerId(packageManagerField: string | undefined): PackageManagerId; /** * Try to resolve the nearest official wp-typia workspace from `startDir`. * * @param startDir Directory to begin walking upward from. * @returns The resolved `WorkspaceProject`, or `null` when no * `WORKSPACE_TEMPLATE_PACKAGE` workspace is found. * @throws {Error} When a discovered `package.json` cannot be parsed. */ export declare function tryResolveWorkspaceProject(startDir: string): WorkspaceProject | null; /** * Resolve the nearest official wp-typia workspace from `startDir`. * * @param startDir Directory to begin walking upward from. * @returns The resolved `WorkspaceProject`. * @throws {Error} When no `WORKSPACE_TEMPLATE_PACKAGE` workspace can be found. */ export declare function resolveWorkspaceProject(startDir: string): WorkspaceProject;