or run

npx @tessl/cli init
Log in

Version

Files

docs

api-services.mdbase-classes.mdcomposables.mdconfiguration.mdindex.mdutilities.md
tile.json

task.mdevals/scenario-2/

Event-Driven Overlay Controller

A utility for broadcasting toasts, confirmations, and dynamic dialogs through the UI library's programmatic overlay services.

All overlay actions must delegate to the dependency's programmatic overlay services (event-bus driven) instead of manually mounting overlay components.

Capabilities

Trigger toast notifications

  • Calling notify with severity, summary, optional detail, and optional life posts a toast matching the payload, optional group, and auto-hides after the specified life (defaults to library default). @test

Request confirmation

  • Calling confirm with message/header resolves to true when the user accepts and false when they reject, honoring provided button labels or icons when supplied. @test

Open a dynamic dialog

  • Calling openDialog with header, content string, and optional closable flag opens a dismissible dialog; invoking the returned close handle removes the same dialog instance. @test

Implementation

@generates

API

export type Severity = 'success' | 'info' | 'warn' | 'error';

export interface ToastRequest {
  severity: Severity;
  summary: string;
  detail?: string;
  life?: number;
  group?: string;
}

export interface ConfirmRequest {
  message: string;
  header?: string;
  icon?: string;
  acceptLabel?: string;
  rejectLabel?: string;
}

export interface DialogRequest {
  header: string;
  content: string;
  closable?: boolean;
}

export interface DialogHandle {
  close(): void;
}

export interface OverlayController {
  notify(request: ToastRequest): void;
  confirm(request: ConfirmRequest): Promise<boolean>;
  openDialog(request: DialogRequest): DialogHandle;
}

/**
 * Creates a controller that routes overlay requests through the UI library's programmatic overlay services and their event buses.
 */
export function createOverlayController(): OverlayController;

Dependencies { .dependencies }

PrimeVue overlay services { .dependency }

Programmatic overlay services for toasts, confirmation prompts, and dynamic dialogs delivered over event buses.