import type { Profile } from "../profiles/types.js"; export declare const ARCHIVE_VERSION = 1; export declare const SNAPSHOT_NAME = "fantastic.db"; /** يدويّة بضغطة المالك، أو تلقائية من الجدولة الليلية. */ export type BackupKind = "auto" | "manual"; /** * AR: **اسم الملفّ هو السجلّ** (٠٢٧). * * لا جدول نسخٍ في قاعدة البيانات، ولا يجوز أن يوجد: القاعدة هي ما يُستعاد ويُصفَّر، فسجلٌّ * داخلها يُمحى في اللحظة التي يُحتاج فيها — يستعيد المالك نسخةً فيجد سجلّ نسخه سجلَّ الأمس. * فالنوع والطابع الزمنيّ يُكتبان في الاسم، وتقرؤهما النواة بقراءة مجلّد **بلا أن تفتح * أرشيفًا واحدًا**. * * ونسخةٌ يسقطها المالك في المجلّد من فلاشة تظهر في القائمة بلا خطوة استيراد — لأن لا شيء * يُسجَّل عنها في مكانٍ آخر أصلًا. * EN: **The file name is the record** (027). * * There is no backups table in the database, and there must not be: the database is what gets * restored and reset, so a record inside it is erased exactly when it is needed — the owner * restores a backup and finds his backup list is yesterday's. So the kind and the timestamp are * written into the name, and the core reads them by listing a directory **without opening a * single archive**. * * And a backup the owner drops into the directory from a USB stick appears in the list with no * import step — because nothing about it was ever recorded anywhere else. */ export declare function backupFileName(kind: BackupKind, stamp: string): string; export interface BackupManifest { archiveVersion: number; createdAt: string; profile: string; /** إصدار النواة وقت النسخ، لتشخيص استعادة عبر إصدارات. */ coreVersion?: string; /** عدد الهجرات المطبَّقة. الاستعادة إلى قاعدة أقدم تُرفَض عليه. */ schemaRevision: number; includesLogs: boolean; /** * AR: النوع، **مكرَّرًا عمدًا** مع ما في اسم الملفّ. * * الاسم يخدم القائمة على الجهاز، وهو أرخص وأسرع. والبيان يخدم أرشيفًا **غادر الجهاز**: نُقل * إلى فلاشة وأُعيدت تسميته، أو وصل من جهازٍ آخر. عندئذٍ يبقى في الأرشيف ما يقول ما كان. * * وغيابه يُقرأ «يدوية»: أرشيفٌ أُخذ قبل هذه الميزة لا يعرف النوع، **ونسخةٌ يدوية لا تُحذف * باستبقاءٍ تلقائيّ** — فالافتراض الآمن هو الذي لا يمحو شيئًا. * EN: The kind, **deliberately duplicated** with what the file name carries. * * The name serves the on-device list, and is cheaper and faster. The manifest serves an archive * that has **left the device**: moved to a USB stick and renamed, or arrived from another * machine. Then what it was is still written inside it. * * Its absence reads as "manual": an archive taken before this feature knows no kind, and * **a manual backup is never deleted by retention** — so the safe default is the one that * erases nothing. */ kind?: BackupKind; } export interface BackupOptions { outDir: string; includeLogs?: boolean; /** يدويّة ما لم يُقَل غير ذلك: الجدولة وحدها تطلب ‎auto‎، وهي وحدها ما يمسّه الاستبقاء. */ kind?: BackupKind; /** يُستدعى عند كل خطوة للعرض. */ onStep?: (message: string) => void; } export interface BackupResult { file: string; bytes: number; manifest: BackupManifest; } export declare function createBackup(profile: Profile, options: BackupOptions): Promise; //# sourceMappingURL=archive.d.ts.map