Nextcloud EventBus events
This can be extended to allow typing of events like:
Example
// event-bus.d.ts // Extend the Nextcloud events interface for your custom event declaremodule'@nextcloud/event-bus' { exportinterfaceNextcloudEvents { // mapping of 'event name' => 'event type' 'my-event': { foo: number, bar: boolean } } } export {}
// your-code.ts import { subscribe } from'@nextcloud/event-bus' // Here the type of 'params' is infered automatically subscribe('my-event', (params) => { console.debug(params.foo, params.bar) })
Nextcloud EventBus events This can be extended to allow typing of events like:
Example