export declare const UPDATE_DESCRIPTOR = "update.json"; export declare const UPDATE_FILE_FORMAT = 1; export interface UpdateDescriptor { format: typeof UPDATE_FILE_FORMAT; product?: string; version: string; platform: string; coversFrom: string; /** المجلّدات (أو الملفّات) العليا التي تغيّرت — تُجمَّع وتُستبدل؛ وما سواها يبقى مكانه. */ tops: string[]; /** كل ملفّات النسخة الجديدة تحت تلك المجلّدات، بمساراتٍ نسبيّة بفاصل ‎/‎. */ files: string[]; } /** ملف تحديثٍ لا يُطبَّق على هذا الجهاز. **ليس فشلًا للتحديث** — المُنادي ينزّل الحزمة الكاملة. */ export declare class UpdateFileRefused extends Error { constructor(message: string); } /** * AR: مسارٌ نسبيّ لا يخرج من جذره: بلا ‎\‎ ولا ‎:‎ ولا بدايةٍ بـ‎/‎ ولا مقطعٍ فارغ أو ‎.‎ أو ‎..‎. **المسارات من ملفٍّ * صنعه غيرنا**، والنسخ إليها يجري بحساب ‎SYSTEM‎ — مسارٌ واحد يهرب يكتب حيث شاء. * EN: A relative path that does not escape its root: no `\`, no `:`, no leading `/`, no empty, `.` or `..` segment. * **The paths come from a file someone else made**, and copying to them runs as `SYSTEM` — one escaping path * writes wherever it likes. */ export declare function isSafeRelative(path: unknown): path is string; /** يقرأ ‎update.json‎ من الملف المفكوك ويتحقّق منه. يرمي ‎UpdateFileRefused‎ بسببٍ يُقرأ. */ export declare function readUpdateDescriptor(parts: string, expected: { version: string; platform: string; product: string; }): UpdateDescriptor; /** * AR: يجمّع المجلّدات التي تغيّرت في ‎staging‎: كل ملفٍّ من القائمة يُؤخذ من الملف المفكوك إن حمله، وإلّا من * الشجرة المثبَّتة. **ما ليس في القائمة لا يُنسخ** — ملفٌّ حُذف في النسخة الجديدة يختفي بهذا وحده. وملفٌّ لا * يوجد في أيٍّ منهما يُرفض الملفُّ كلّه: النسخة المثبَّتة أقدم ممّا يغطيه. * * **نسخٌ لا روابط**: الشجرة القديمة تبقى سليمة بايتًا ببايت لطريق العودة. * EN: Assembles the changed folders in `staging`: each listed file is taken from the unpacked update when it carries * it, otherwise from the installed tree. **What is not listed is not copied** — a file deleted in the new version * disappears by that alone. A file found in neither refuses the whole update: the installed version is older * than what it covers. * * **Copies, not links**: the old tree stays intact byte for byte as the way back. * * AR: 054: **غير متزامن ومع عدّاد.** ‎0.75.0‎ ينسخ هنا ‎23,909‎ ملفًّا؛ النسخ المتزامن كان يُجمّد الطرفية كلّها فيبدو * التحديث عالقًا. ‎onFile‎ يُنادى بعد كل ملف بما نُسخ ومجموعه. * EN: 054: **asynchronous, with a counter.** 0.75.0 copies 23,909 files here; the synchronous copy froze the whole * terminal so the update looked stuck. `onFile` is called after each file with how many were copied of the total. */ export declare function assembleFromUpdate(parts: string, root: string, staging: string, descriptor: UpdateDescriptor, onFile?: (done: number, total: number) => void): Promise<{ fromUpdate: number; fromInstalled: number; }>; //# sourceMappingURL=update-file.d.ts.map