Skip to content

fix(eventbus): add missing type declarations for EventBus subpath exports#8423

Open
YevheniiKotyrlo wants to merge 1 commit intoprimefaces:masterfrom
YevheniiKotyrlo:fix/eventbus-missing-type-declarations
Open

fix(eventbus): add missing type declarations for EventBus subpath exports#8423
YevheniiKotyrlo wants to merge 1 commit intoprimefaces:masterfrom
YevheniiKotyrlo:fix/eventbus-missing-type-declarations

Conversation

@YevheniiKotyrlo
Copy link

@YevheniiKotyrlo YevheniiKotyrlo commented Feb 6, 2026

Defect Fixes

Fixes #8422

The four EventBus subpath exports (primevue/toasteventbus, primevue/overlayeventbus, primevue/confirmationeventbus, primevue/dynamicdialogeventbus) ship JavaScript but no .d.ts type declarations. Projects using skipLibCheck: false get TS7016 errors — every other PrimeVue subpath export (100+ modules) includes type declarations except these four.

Problem

import ToastEventBus from 'primevue/toasteventbus';
// TS7016: Could not find a declaration file for module 'primevue/toasteventbus'

ToastEventBus.on('add', (message) => {
  // message: any — no type safety for event payloads
});

After this fix, all event bus operations are fully typed:

import ToastEventBus from 'primevue/toasteventbus';

ToastEventBus.on('add', (message) => {
  // message: ToastMessageOptions — full autocomplete and type checking
  console.log(message.severity, message.summary);
});

Root cause

The source directories for these four modules only contain .js and package.json files — no .d.ts — so the build pipeline (copyDependencies in postbuild.mjs) has nothing to copy to dist/.

Changes

  • Add index.d.ts for each EventBus module with typed overloads for on, off, emit, and clear
  • Add "types": "./index.d.ts" to each module's package.json
  • Event types reuse existing PrimeVue types (ToastMessageOptions, ConfirmationOptions, DynamicDialogInstance)
  • Follows the inline typing pattern used by TerminalService.d.ts

Scope / Impact

  • No breaking changes — adds missing declarations, previously resolved as any
  • No runtime changes — types only (.d.ts + package.json types field)
  • 4 modules: toasteventbus, overlayeventbus, confirmationeventbus, dynamicdialogeventbus

Verification

Gate Result
tsc --noEmit with skipLibCheck: false TS7016 resolved for all 4 modules
Event types match runtime behavior Verified against source
All CI gates (format, lint, test, build) PASS

@YevheniiKotyrlo YevheniiKotyrlo changed the title "%TITLE%" fix(eventbus): add missing type declarations for EventBus subpath exports Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing .d.ts type declarations for EventBus subpath exports

1 participant