import type { Profile } from "../profiles/types.js"; import { type SwapHandle } from "./apply.js"; export type RollbackReport = { /** هل عادت الشجرة القديمة إلى مكانها؟ */ restored: boolean; /** هل أقلعت الخدمات بعد العودة؟ */ running: boolean; /** ما تعذّر، إن تعذّر شيء. يُعرَض للفنيّ: هنا يبدأ التدخّل اليدويّ. */ problem?: string; }; /** * AR: يعيد النظام إلى ما كان عليه: يوقف ما أُقلع، ويرجع الشجرة، ثم يشغّل. * * **يُوقِف أوّلًا حتى لو ظنّ المنادي أن شيئًا لم يُقلع.** فشلُ فحص الصحة يعني أن الخدمة * **أُقلعت** بالحزمة الجديدة ولم تجب — أي أن عمليةً حيّة تمسك ملفّات الشجرة الجديدة، * وإعادةُ التسمية فوقها تفشل على ويندوز. الإيقاف قبل التراجع هو ما يجعل التراجع ممكنًا. * * **ويعيد تقريرًا ولا يرمي.** هذه آخر شبكة أمان في المسار: استثناءٌ يخرج منها يترك المالك * بأثر مكدّس بدل جملةٍ تقول له ما حال نظامه الآن. * * EN: Returns the system to what it was: stops whatever started, restores the tree, then starts. * * **It stops first even when the caller believes nothing started.** A failed health check means * the service **did** start on the new bundle and did not answer — so a live process is holding * the new tree's files, and renaming over it fails on Windows. Stopping before rolling back is * what makes the rollback possible. * * **And it returns a report rather than throwing.** This is the last safety net on the path: an * exception escaping it leaves the owner with a stack trace instead of a sentence telling them * what state their system is in now. */ export declare function rollback(profile: Profile, handle: SwapHandle): Promise; //# sourceMappingURL=rollback.d.ts.map