GemBox.PdfViewer
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    EventElement Interface

    Namespace:
    @gembox/pdfviewer
    Assembly:
    @gembox/pdfviewer

    An event-emitting interface that allows for type-safe event handling.

    • TypeScript
    export declare interface EventElement<TEventMap extends {
        [key: string]: any;
    }>
    Remarks

    This interface provides a generic way to handle events with strongly-typed event data. It supports both synchronous and asynchronous event listeners, allowing for flexible event handling patterns.

    Methods

    addEventListener(K, (event: TEventMap[K]) => void)

    Adds an event listener for the specified event type.

    • TypeScript
    addEventListener<K extends keyof TEventMap & string>(type: K, listener: (event: TEventMap[K]) => void): void;
    Parameters
    type

    The event type/name to listen for.

    listener

    The callback function that will be invoked when the event is emitted.

    Remarks

    Multiple listeners can be registered for the same event type. The listener will be called with the strongly-typed event data when the event is emitted.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.