export interface MachinePathValue { /** القيمة كما هي في السِّجل، **غير مُوسَّعة**. */ raw: string; /** ‎ExpandString‎ عادةً. يُعاد كما هو حتى لا نغيّر نوع قيمة لم نُنشئها. */ kind: string; } /** * AR: يفكّ قيمة PATH إلى مُدخلاتها. الفاصلة المنقوطة فاصل، والمدخلات الفارغة تُسقَط: قيمة تنتهي * بفاصلة منقوطة شائعة جدًّا، وإبقاء الفراغ ينتج مُدخلًا يعني «المجلد الحالي» — ثغرة معروفة. * EN: Splits a PATH value into its entries. Semicolon separates, and empty entries are dropped: a * value ending in a semicolon is very common, and keeping the blank yields an entry meaning "the * current directory" — a well-known hazard. */ export declare function pathEntries(value: string): string[]; export declare function pathContains(value: string, entry: string): boolean; /** * AR: القيمة بعد الإضافة، أو ‎null‎ إن كان المُدخَل موجودًا فلا كتابة أصلًا. الإضافة في **النهاية**: * مُدخَلٌ في المقدّمة يسبق أدوات النظام ويحجب ما يشبهه اسمًا، وليس لنا حقّ في ذلك على جهاز لا * نملكه. * EN: The value after adding, or `null` when the entry is already present so nothing is written at * all. Appended at **the end**: an entry at the front precedes the system's own tools and shadows * anything sharing a name, which is not our right on a machine we do not own. */ export declare function addToPath(value: string, entry: string): string | null; /** * AR: القيمة بعد الإزالة، أو ‎null‎ إن لم يكن موجودًا. يُزيل كل نسخة منه — تثبيتات سابقة قد تكون * خلّفت مكرّرات قبل أن يوجد فحص التكرار. * EN: The value after removal, or `null` when it is not present. Removes every copy — earlier * installations may have left duplicates before the duplicate check existed. */ export declare function removeFromPath(value: string, entry: string): string | null; /** * AR: يعيد ملفّ ‎fantastic‎ الذي يفوز على PATH إن لم يكن شيمتنا، وإلّا ‎undefined‎. يقرأ PATH العملية * الحالية لا السِّجل: السؤال هو «ماذا يحدث حين يُكتب الاسم الآن»، لا «ماذا سيحدث بعد إعادة فتح». * EN: Returns the `fantastic` file that wins on PATH when it is not our shim, else `undefined`. It * reads the current process's PATH rather than the registry: the question is "what happens when * the name is typed now", not "what will happen after a fresh terminal". */ export declare function fantasticOnPath(): string | undefined; export declare function findConflictingCommand(ourShim: string): string | undefined; /** * AR: هل يفوز **شيمتنا** على PATH؟ السؤال معكوسُ الذي فوقه، وقد انقلب معناه في ٠٢٦. * * كانت الشيمة طريق الفنّي إلى الواجهة، ففوزُها هو المطلوب وفوزُ غيرها تعارض. وقد صارت * الشيمة تصل إلى **المُشرِف** الذي لا يقبل أوامر، وصار الفنّي يصل إلى الواجهة من ‎npm‎ — * ففوزها اليوم هو العطل: يكتب الفنّي ‎fantastic‎ فيبدأ الإشراف ويقف، بلا رسالةٍ ولا شيءٍ * معطوب. **تعليقٌ لا خطأ**، وهو أصعب ما يُشخَّص عن بُعد. * EN: Does **our shim** win on PATH? The inverse of the question above, and its meaning inverted * in 026. * * The shim used to be the technician's route to the CLI, so its winning was the goal and * anything else winning was a conflict. The shim now reaches **the supervisor**, which takes no * commands, and the technician reaches the CLI from `npm` — so its winning is today's fault: the * technician types `fantastic`, supervision starts, and it sits there with no message and * nothing broken. **A hang rather than an error**, which is the hardest thing to diagnose from * a distance. */ export declare function shimWinsOnPath(ourShim: string): boolean; /** يقرأ PATH الآلة غير مُوسَّعة، مع نوع قيمتها. ‎undefined‎ على غير ويندوز أو عند تعذّر القراءة. */ export declare function readMachinePath(): Promise; export interface PathChange { /** * AR: ما وقع فعلًا، **بثلاث حالاتٍ لا اثنتين**. * * كان الحقل ‎changed: boolean‎ وتعليقه يقول إن ‎false‎ تعني «كان صحيحًا أصلًا لا فشل» — * بينما فرعُ الفشل كان يعيد ‎false‎ هو أيضًا. فاختلطت الحالتان عند كل قارئ، وطبع * ‎migrate-cli‎ «لا شيء يحتاج تغييرًا» على كتابةٍ رفضها السِّجل: **فشلٌ يُقرأ نجاحًا**، * والفنّي يمضي ظانًّا أن العطل زال وهو في مكانه. * EN: What actually happened, **in three states rather than two**. * * The field was `changed: boolean`, its comment insisting `false` meant "was already correct, * not failed" — while the failure branch returned `false` as well. The two collapsed at every * reader, and `migrate-cli` printed "nothing needed changing" over a write the registry had * refused: **a failure read as a success**, with the technician walking away believing a fault * was gone while it sat exactly where it was. */ outcome: "changed" | "unchanged" | "failed"; detail: string; backupPath?: string; } /** يُضيف مجلدًا إلى PATH الآلة إن لم يكن فيه. */ export declare function registerOnMachinePath(entry: string, logDir: string): Promise; /** يُزيل مجلدًا من PATH الآلة إن كان فيه. جهازٌ أُزيل عنه النظام لا يبقى فيه أثرٌ ميّت. */ export declare function unregisterFromMachinePath(entry: string, logDir: string): Promise; //# sourceMappingURL=machine-path.d.ts.map