import { type PackageManagerId } from '../shared/package-managers.js'; import type { JsonValue, ManifestAttribute, JsonObject } from './migration-types.js'; import { type UnknownRecord } from '../shared/object-utils.js'; export { cloneJsonValue } from '../shared/json-utils.js'; export declare function getValueAtPath(input: TRecord, pathLabel: string): unknown; export declare function setValueAtPath(input: TRecord, pathLabel: string, value: unknown): TRecord; export declare function deleteValueAtPath(input: TRecord, pathLabel: string): TRecord; export declare function createFixtureScalarValue(pathLabel: string): JsonValue; export declare function createTransformFixtureValue(attribute: ManifestAttribute | null | undefined, pathLabel: string): JsonValue; export declare function readJson(filePath: string): T; export declare function renderPhpValue(value: unknown, indentLevel: number): string; export declare function copyFile(sourcePath: string, targetPath: string): void; export declare function sanitizeSaveSnapshotSource(source: string): string; export declare function sanitizeSnapshotBlockJson(blockJson: JsonObject): JsonObject; export declare function runProjectScriptIfPresent(projectDir: string, scriptName: string): void; export declare function detectPackageManagerId(projectDir: string): PackageManagerId; export declare function getLocalTtsxBinary(projectDir: string): string; /** * Returns whether isInteractiveTerminal() is running with both stdin and stdout * attached to a TTY so CLI and migration flows can safely prompt the user. */ export declare function isInteractiveTerminal(): boolean; /** * Resolves the `current` sentinel to the current migration version label. * * @param currentMigrationVersion Current migration version label for the workspace. * @param value Requested target value, which may be `current`. * @returns The concrete migration version label that should be used. */ export declare function resolveTargetMigrationVersion(currentMigrationVersion: string, value: string): string; /** * Returns whether a value matches the canonical `vN` migration label format. * * @param value Candidate migration version label. * @returns `true` when the value is a valid `vN` label with `N >= 1`. */ export declare function isMigrationVersionLabel(value: string): boolean; /** * Returns whether a value looks like a legacy semver-based migration label. * * @param value Candidate migration version label. * @returns `true` when the value matches the legacy `x.y.z` semver pattern. */ export declare function isLegacySemverMigrationVersion(value: string): boolean; /** * Throws when a migration version label does not match the canonical `vN` format. * * @param value Candidate migration version label. * @param label Human-readable label used in the thrown error message. * @returns Nothing. * @throws Error When the provided value is not a valid `vN` migration label. */ export declare function assertMigrationVersionLabel(value: string, label: string): void; /** * Compares two migration version labels by their numeric suffix. * * @param left Left migration version label. * @param right Right migration version label. * @returns A negative number when `left < right`, zero when equal, and a positive number when `left > right`. */ export declare function compareMigrationVersionLabels(left: string, right: string): number; /** * Formats the reset guidance shown when a legacy semver migration workspace is detected. * * @param reason Optional leading reason that explains what legacy pattern was found. * @returns A user-facing guidance string that explains how to reset to `v1` labels. */ export declare function formatLegacyMigrationWorkspaceResetGuidance(reason?: string): string; export declare function escapeForCode(value: unknown): string; export declare function renderObjectKey(key: string): string; export declare function isNumber(value: unknown): value is number;