/**
* AR: معرّف المنصّة في التوزيع: لاحقة مجلد الحزمة، واسم ملفّها، وعمود platform في البوّابة،
* والمعامل في /api/v1/setup/latest. **هذا هو المعرّف الذي يراه إنسان.**
* EN: The distribution identifier: the bundle folder's suffix, its file name, the portal's
* `platform` column, and the query parameter on `/api/v1/setup/latest`. **This is the
* identifier a human sees.**
*/
export type BundlePlatformId = "win-x64" | "linux-x64";
export interface PlatformSpec {
/** معرّف التوزيع: win-x64 / linux-x64. */
id: BundlePlatformId;
/**
* AR: ما يُكتب في updates/versions.json تحت bundle.platform. **ويندوز يحتفظ بالتهجئة
* القديمة** لأن واجهات الميدان تقارنها حرفيًّا.
* EN: What is written into `updates/versions.json` as `bundle.platform`. **Windows keeps the
* legacy spelling** because CLIs in the field compare it literally.
*/
manifestId: "win32-x64" | "linux-x64";
/** ما يقوله process.platform على هذه المنصّة. */
nodePlatform: "win32" | "linux";
arch: "x64";
/** اسم كل ملفّ داخل runtime/. */
runtimeFiles: {
node: string;
ffmpeg: string;
ffprobe: string;
};
/** اسم كل شيمة داخل bin/. */
shimFiles: {
command: string;
updater: string;
maintenance: string;
};
/** لغة الشيمة: ملفّ دفعة ويندوز، أو sh قابل للتنفيذ. */
shimKind: "cmd" | "sh";
/**
* الإضافات الأصلية التي **يجب** أن توجد في شجرة اعتماديات كل خدمة على هذه المنصّة.
*
* غيابها لا يُفشل البناء ولا بدء العملية: يظهر عند أول استعلام قاعدة أو أول مصغّرة — أي عند
* العميل. لذلك تُفحَص صراحةً قبل الأرشفة وبعد كل فكّ (017/FR-019).
*/
requiredNative: {
core: readonly string[];
live: readonly string[];
};
/** مجلد حزمة المُثبِّت التي تُنسَخ منها ثنائيّات الوسائط: @ffmpeg-installer/
/. */
ffmpegInstallerDir: "win32-x64" | "linux-x64";
/**
* AR: ما يجب أن يكون قابلًا للتنفيذ بعد الفكّ، نسبةً إلى الجذر.
*
* **الأرشيف لا يحمل بتّ التنفيذ إلينا.** الحزمة تُبنى على ويندوز فيسجّل archiver الوضع
* 0o666 على كل مدخل (مقيس على Fantastic-0.27.0-win-x64.zip)، وyauzl الذي نفكّ به لا
* يطبّق أوضاعًا أصلًا. فحتى حزمةٌ بُنيت على لينكس تصل بلا بتّ تنفيذ إن مرّت بأرشيفٍ كُتب
* على ويندوز. لذلك يُمنح البتّ **بعد كل فكّ** من هذه القائمة، لا يُنتظَر من الأرشيف.
*
* وعلى ويندوز القائمة فارغة: النظام لا يعرف بتّ تنفيذ، وchmod فيه لا معنى له.
* EN: What must be executable after extraction, relative to the install root.
*
* **The archive does not carry the executable bit to us.** A bundle built on Windows records
* mode `0o666` on every entry (measured on `Fantastic-0.27.0-win-x64.zip`), and `yauzl`,
* which we extract with, never applies modes at all. So even a bundle built on Linux arrives
* without the bit if it passed through an archive written on Windows. The bit is therefore
* granted **after every extraction** from this list, never expected from the archive.
*
* On Windows the list is empty: the system has no executable bit and `chmod` means nothing.
*/
executables: readonly string[];
/** جذر التثبيت الافتراضي. */
applianceRoot: string;
/**
* AR: أين يعيش سِجلّ المنتجات المثبَّتة. **على مستوى الآلة لا المستخدم**: جهاز العميل يُستعمل
* من حسابات مختلفة، ومن يدخل بحسابٍ آخر يجب أن يجد ما رُكِّب.
* EN: Where the registry of installed products lives. **Machine-wide, not per user**: a
* customer's appliance is used from different accounts, and a technician signing in as
* someone else must still find what was installed.
*/
registryDir(): string;
/** المواضع التي يبحث فيها rebuild عن تثبيتات. قائمة قصيرة مقصودة. */
searchRoots(): string[];
}
/**
* AR: **موضع السجلّ يُعلَن صراحةً حين يلزم.**
*
* FANTASTIC_HOME موجودٌ منذ زمن ليقول «الجهاز هنا لا في مكانه المعتاد»؛ وهذا نظيره للسجلّ.
* ويلزم في حالتين حقيقيّتين: تثبيتٌ على لينكس بحسابٍ غير root في موضعٍ يختاره من ثبّت،
* واختبارٌ يجب أن يعمل على المنصّتين بلا أن يكتب في /var/lib ولا في %ProgramData% الحقيقيّ.
*
* ويُقرأ قبل كل شيء لأن التصريح يسبق الاستنتاج، وهي القاعدة نفسها في findApplianceRoot.
* EN: **The registry's location is stated explicitly when it must be.**
*
* `FANTASTIC_HOME` has long existed to say "the appliance is here, not in its usual place"; this
* is its counterpart for the registry. It is needed in two real cases: a Linux install under a
* non-root account in a location its installer chose, and a test that must run on both platforms
* without writing into the real `/var/lib` or `%ProgramData%`.
*
* It is read before anything else because a declaration precedes an inference — the same rule as
* in `findApplianceRoot`.
*/
export declare const REGISTRY_DIR_ENV = "FANTASTIC_REGISTRY_DIR";
export declare const PLATFORMS: Record;
/** كل معرّفات المنصّات المعروفة، للتحقّق من علَمٍ أو معامل استعلام. */
export declare const PLATFORM_IDS: readonly BundlePlatformId[];
/**
* AR: المنصّة التي نعمل عليها الآن. **تُستنتَج ولا تُمرَّر**: الواجهة لا تملك علَم منصّة لأن
* السؤال «أيّ منصّة أنا؟» لا يحتمل جوابًا من مستخدم — والجواب الخاطئ يعني حزمةً تُنزَّل
* بالكامل ثم تُرفَض، أو أسوأ: تُفكّ ثم لا تُقلع.
*
* والمنصّة غير المدعومة تُقال بصراحة: darwin أو arm64 لا تُنتَج لهما حزمة، ورسالةٌ صادقة
* خيرٌ من فشلٍ غامض بعد تنزيل 139 ميغابايت.
* EN: The platform we are running on. **Detected, never passed**: the CLI has no platform flag
* because "which platform am I?" admits no answer from a user — and a wrong answer means a
* bundle downloaded in full and then refused, or worse: extracted and then unable to boot.
*
* An unsupported platform is said plainly: no bundle is produced for darwin or arm64, and an
* honest message beats an obscure failure after a 139 MB download.
*/
export declare function currentPlatform(): PlatformSpec;
/** هل هذه المنصّة مدعومة؟ سؤالٌ لا يرمي، لمن يريد أن يقرّر بنفسه. */
export declare function isSupportedPlatform(): boolean;
/**
* AR: يحلّ معرّفًا مكتوبًا — علَم --platform أو معامل استعلام — إلى صفّه في الجدول.
* **يرمي برسالةٍ تسمّي المقبول**، لأن من كتب --platform linux يحتاج أن يعرف أنها
* linux-x64، لا أن يُقال له «قيمة غير صالحة».
* EN: Resolves a written identifier — a `--platform` flag or a query parameter — to its row.
* **Throws with a message naming what is accepted**, because whoever typed `--platform linux`
* needs to learn it is `linux-x64`, not to be told "invalid value".
*/
export declare function platformById(id: string): PlatformSpec;
/**
* AR: هل يقبل هذا الجهاز حزمةً بيانُها يقول كذا؟
*
* **الرفض مقصود ومبكّر.** حزمةٌ لمنصّةٍ أخرى لن تعمل أبدًا — ثنائيّاتها لا تُشغَّل هنا
* أصلًا — فرفضُها قبل أوّل بايت يُكتب خيرٌ من جهازٍ نصف مركَّب. وهذه الدالّة هي المكان
* الوحيد الذي يقارن، فلا يبقى === "win32-x64" منثورًا في الشيفرة.
* EN: Does this machine accept a bundle whose manifest says so?
*
* **The refusal is deliberate and early.** A bundle for another platform will never run — its
* binaries do not execute here at all — so refusing it before the first byte is written beats
* a half-assembled appliance. This function is the only place that compares, so no
* `=== "win32-x64"` stays scattered through the code.
*/
export declare function manifestAccepts(spec: PlatformSpec, manifestPlatform: string): boolean;
/**
* AR: صفّ الجدول الذي يوافق بيانًا. يُستعمل حين نريد أن نسمّي منصّة حزمةٍ رُفضت
* («هذه حزمة لينكس، وأنت على ويندوز») بدل أن نكتفي بعرض السلسلة الخام.
* EN: The table row matching a manifest string. Used when a refused bundle's platform should be
* named ("this is a Linux bundle and you are on Windows") rather than shown as a raw string.
*/
export declare function platformByManifestId(manifestPlatform: string): PlatformSpec | undefined;
//# sourceMappingURL=platform.d.ts.map