import { Injectable, signal } from '@angular/core'; export interface PromptRequest { title: string; placeholder?: string; initial?: string; confirmLabel: string; onConfirm: (value: string) => void; } export interface ConfirmRequest { title: string; body: string; confirmLabel: string; destructive?: boolean; onConfirm: () => void; } export interface ChmodRequest { targets: string[]; // display names initialMode: number; onConfirm: (mode: number) => void; } @Injectable({ providedIn: 'root' }) export class DialogsService { readonly prompt = signal(null); readonly confirm = signal(null); readonly chmod = signal(null); get anyOpen(): boolean { return !!(this.prompt() || this.confirm() || this.chmod()); } closeAll(): void { this.prompt.set(null); this.confirm.set(null); this.chmod.set(null); } }