export declare const UPDATE_FAILURES_FILE = "update-failures.json"; export interface UpdateFailure { version: string; sha256: string; /** كم مرّة فشلت هذه البصمة بعينها. */ attempts: number; lastAt: string; reason: string; } /** آخر فشلٍ محفوظ، أو ‎null‎. **لا يرمي**: ملفٌّ تالف يعني لا ذاكرة، لا جهازًا لا يُقلع. */ export declare function readFailure(runDir: string): UpdateFailure | null; /** هل فشلت هذه البصمة بعينها من قبل؟ */ export declare function failedBefore(runDir: string, sha256: string): UpdateFailure | null; /** يومٌ قبل المحاولة الثانية، ولا ثالثة بلا يد. */ export declare const RETRY_AFTER_MS: number; export declare const MAX_AUTOMATIC_ATTEMPTS = 2; /** * AR: هل يتخطّى التحديثُ التلقائيّ هذا الفشل؟ **محاولةٌ ثانية بعد يوم** لأن بعض الفشل عابرٌ وإن وقع بعد * التنزيل (مضادّ فيروسات أمسك ملفًّا أثناء التبديل)، **ولا ثالثة**: حزمةٌ فشلت مرّتين على الجهاز نفسه * لا تُعاد حتى يُنشر غيرها أو يطلبها إنسانٌ بـ‎fantastic update‎. * EN: Does the automatic update skip this failure? **A second attempt after a day**, because some * failures are passing even after the download (an antivirus holding a file during the swap), **and no * third**: a bundle that failed twice on the same machine is not retried until another is published * or a person asks for it with `fantastic update`. */ export declare function skipsAutomatic(failure: UpdateFailure, now?: Date): boolean; /** * AR: يحفظ الفشل **ذرّيًّا** (ملفٌّ مؤقّت ثم إعادة تسمية): انقطاع كهرباءٍ في منتصف الكتابة لا يترك * نصف ملفّ. **ولا يرمي**: فشلٌ في حفظ الذاكرة لا يُضاف إلى فشل التحديث. * EN: Records the failure **atomically** (a temporary file, then a rename): a power cut mid-write leaves * no half file. **And it never throws**: failing to save the memory is not added to the update's * failure. */ export declare function recordFailure(runDir: string, input: { version: string; sha256: string; reason: string; }, now?: Date): UpdateFailure; /** يمحو الذاكرة بعد تحديثٍ نجح. */ export declare function clearFailure(runDir: string): void; //# sourceMappingURL=update-failures.d.ts.map