import { type IrIdentityIndex } from '../model/ir-identity.js'; /** * Why a package rename or delete is only a text edit. * * Said once here so every surface says the same thing, and phrased as what was * *not* done: the edit succeeded, and the references it invalidated are the * caller's to fix until the linker can do it. */ export declare const PACKAGE_EDIT_IS_TEXT_ONLY: string; export interface PackageWriteResult { success: boolean; /** Project-relative files this operation wrote. */ filePaths: string[]; /** Qualified name of the package the operation produced or acted on. */ qualifiedName?: string; /** Advisory notes about a write that succeeded. */ warnings?: { code: 'package-edit-is-text-only'; message: string; }[]; error?: string; /** Set when the failure was a stale element identity, so callers can say so. */ stale?: boolean; } /** * Declare a new package. * * With a parent, the package is nested inside that declaration; without one it * is appended at the file's top level. Nesting rather than minting a new file * keeps the edit to a single range in a file the caller already named — the * catalog's namespace-to-directory mirroring is a project layout decision, not * something a right-click in a tree should quietly make. */ export declare function createPackage(cwd: string, request: { file: string; parent?: string; name: string; }): Promise; /** * Rename a package in place. * * Only the declared name token is replaced; members keep their positions, so * the operation cannot reorder or reformat a file around them. */ export declare function renamePackage(cwd: string, request: { file: string; qualifiedName: string; name: string; }): Promise; /** * Re-parent a package: move its whole declaration under another package. * * The declaration is moved verbatim, so everything it declares moves with it — * which is what makes this one operation rather than a move per member. Moving * a package into itself or into its own descendant is refused: the result would * be a namespace that contains the thing containing it. */ export declare function movePackage(cwd: string, request: { file: string; qualifiedName: string; /** Absent means the file's top level. */ targetParent?: string; targetFile: string; }): Promise; /** * Remove a package declaration, keeping everything it declares. * * The members are lifted into the enclosing scope rather than deleted: emptying * a container is a containment change, and silently deleting a subtree of the * model because someone removed a folder would be the most expensive possible * reading of that gesture. */ export declare function deletePackage(cwd: string, request: { file: string; qualifiedName: string; }): Promise; /** * Move a nested declaration into a grouping package beside it. * * Addressed by qualified name rather than by IR identity, for the same reason * the package operations are: the IR does not ingest a declaration nested in a * usage body, so it has no identity to quote — and a name path IS an address, * because two members of one namespace cannot share a name. * * The move stays inside one file. A grouping package groups what its OWNER * declares, so a member arriving from another file would be a containment * change wearing a grouping change's clothes; `moveElementToPackage` is the * operation for that. */ export declare function moveIntoGroupingPackage(cwd: string, request: { file: string; qualifiedName: string; targetPackage: string; }): Promise; /** * Move one element's declaration into another package. * * The declaration text is moved verbatim — this is a containment change, not a * rewrite, so nothing the user authored inside the declaration is regenerated. * The element is addressed by IR identity, exactly as an update is, so a move * made against a stale revision fails loudly instead of cutting whatever now * occupies that position. */ export declare function moveElementToPackage(cwd: string, request: { elementId: string; irIdentity: string; sourceFile: string; targetFile: string; /** Absent means the file's top level. */ targetPackage?: string; }, index: IrIdentityIndex): Promise; //# sourceMappingURL=package-writer.d.ts.map