@duckduckgo/content-scope-scripts
    Preparing search index...

    Class WindowsInteropMethods

    These are the required methods

    Index

    Constructors

    • Parameters

      • params: {
            addEventListener: {
                <K extends keyof WindowEventMap>(
                    type: K,
                    listener: (this: Window, ev: WindowEventMap[K]) => any,
                    options?: boolean | AddEventListenerOptions,
                ): void;
                (
                    type: string,
                    listener: EventListenerOrEventListenerObject,
                    options?: boolean | AddEventListenerOptions,
                ): void;
            };
            postMessage: {
                (message: any, targetOrigin: string, transfer?: Transferable[]): void;
                (message: any, options?: WindowPostMessageOptions): void;
            };
            removeEventListener: {
                <K extends keyof WindowEventMap>(
                    type: K,
                    listener: (this: Window, ev: WindowEventMap[K]) => any,
                    options?: boolean | EventListenerOptions,
                ): void;
                (
                    type: string,
                    listener: EventListenerOrEventListenerObject,
                    options?: boolean | EventListenerOptions,
                ): void;
            };
        }
        • addEventListener: {
              <K extends keyof WindowEventMap>(
                  type: K,
                  listener: (this: Window, ev: WindowEventMap[K]) => any,
                  options?: boolean | AddEventListenerOptions,
              ): void;
              (
                  type: string,
                  listener: EventListenerOrEventListenerObject,
                  options?: boolean | AddEventListenerOptions,
              ): void;
          }
        • postMessage: {
              (message: any, targetOrigin: string, transfer?: Transferable[]): void;
              (message: any, options?: WindowPostMessageOptions): void;
          }
        • removeEventListener: {
              <K extends keyof WindowEventMap>(
                  type: K,
                  listener: (this: Window, ev: WindowEventMap[K]) => any,
                  options?: boolean | EventListenerOptions,
              ): void;
              (
                  type: string,
                  listener: EventListenerOrEventListenerObject,
                  options?: boolean | EventListenerOptions,
              ): void;
          }

      Returns WindowsInteropMethods

    Properties

    addEventListener: {
        <K extends keyof WindowEventMap>(
            type: K,
            listener: (this: Window, ev: WindowEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        (
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
    }

    Type Declaration

      • <K extends keyof WindowEventMap>(
            type: K,
            listener: (this: Window, ev: WindowEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void
      • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

        MDN Reference

        Type Parameters

        • K extends keyof WindowEventMap

        Parameters

        • type: K
        • listener: (this: Window, ev: WindowEventMap[K]) => any
        • Optionaloptions: boolean | AddEventListenerOptions

        Returns void

      • (
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void
      • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

        MDN Reference

        Parameters

        • type: string
        • listener: EventListenerOrEventListenerObject
        • Optionaloptions: boolean | AddEventListenerOptions

        Returns void

    postMessage: {
        (message: any, targetOrigin: string, transfer?: Transferable[]): void;
        (message: any, options?: WindowPostMessageOptions): void;
    }

    Type Declaration

      • (message: any, targetOrigin: string, transfer?: Transferable[]): void
      • The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.

        MDN Reference

        Parameters

        • message: any
        • targetOrigin: string
        • Optionaltransfer: Transferable[]

        Returns void

      • (message: any, options?: WindowPostMessageOptions): void
      • Parameters

        • message: any
        • Optionaloptions: WindowPostMessageOptions

        Returns void

    removeEventListener: {
        <K extends keyof WindowEventMap>(
            type: K,
            listener: (this: Window, ev: WindowEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        (
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Type Declaration

      • <K extends keyof WindowEventMap>(
            type: K,
            listener: (this: Window, ev: WindowEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void
      • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

        MDN Reference

        Type Parameters

        • K extends keyof WindowEventMap

        Parameters

        • type: K
        • listener: (this: Window, ev: WindowEventMap[K]) => any
        • Optionaloptions: boolean | EventListenerOptions

        Returns void

      • (
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void
      • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

        MDN Reference

        Parameters

        • type: string
        • listener: EventListenerOrEventListenerObject
        • Optionaloptions: boolean | EventListenerOptions

        Returns void