@nextcloud/event-bus
    Preparing search index...

    Interface NextcloudEvents

    Nextcloud EventBus events This can be extended to allow typing of events like:

    // event-bus.d.ts
    // Extend the Nextcloud events interface for your custom event
    declare module '@nextcloud/event-bus' {
    export interface NextcloudEvents {
    // 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 inferred automatically
    subscribe('my-event', (params) => { console.debug(params.foo, params.bar) })

    Indexable

    • [eventName: string | symbol]: Event