ComPDFKit Web SDK
    Preparing search index...

    Class Dispatcher

    Stores actions by trigger name ('U' mouse up, 'D' mouse down, ...) and runs them in order on trigger: GoTo navigates, URI opens, Named navigates or prints, Hide shows or hides fields, ResetForm resets. GoToR is not executed.

    Index
    • Creates a dispatcher.

      Parameters

      • Optionalinit: { actions?: Record<string, Action[]>; documentViewer?: DocumentViewer }

        Optional initial state.

        • Optionalactions?: Record<string, Action[]>

          Initial actions keyed by trigger name.

        • OptionaldocumentViewer?: DocumentViewer

          Viewer used when trigger is called without one.

      Returns Dispatcher

    • Appends an action to the list run for a trigger.

      Parameters

      • trigger: string

        Trigger name, such as 'U' (mouse up) or 'D' (mouse down).

      • action: Action

        The action to add.

      Returns void

    • Returns all actions keyed by trigger name.

      Returns Record<string, Action[]>

      The live map of trigger names to their action lists.

    • Runs every action registered for a trigger, in order. Does nothing when no viewer is available.

      Parameters

      • triggerName: string

        Trigger name, such as 'U' or 'D'.

      • target: Core.Annotations.Annotation | null

        The annotation that fired the trigger, or null.

      • event: Event | null

        The originating DOM event, or null.

      • Optionalviewer: DocumentViewer

        Viewer to run the actions against; defaults to the viewer given to the constructor.

      Returns void