@arcmantle/library
    Preparing search index...

    Function waitForEvent

    • Waits for a specific event to be emitted from an element.

      Ignores events that bubble up from child elements.

      Gets type information from the global type HTMLElementEventMap

      Type Parameters

      • T extends HTMLElementEventMap
      • R extends keyof HTMLElementEventMap
      • K extends string = R

      Parameters

      • el: HTMLElement | Window
      • eventName: R | K
      • Optionaloptions: {
            bubbles?: boolean;
            continue?: (
                ev: T[R] extends CustomEvent<any>
                    ? CustomEvent<any[any]["detail"]>
                    : T[R],
            ) => boolean;
        }
        • Optionalbubbles?: boolean
        • Optionalcontinue?: (
              ev: T[R] extends CustomEvent<any>
                  ? CustomEvent<any[any]["detail"]>
                  : T[R],
          ) => boolean

          Predicate that can be used to terminate the waiting state.

      Returns Promise<EventReturnType<T, R>>