Configuration for a JSDOM environment.

Hierarchy

  • IJSDOMConfiguration

Implemented by

Accessors

Methods

  • Perform any additional environment setup.

    This method gets access to the actual environment in which code will execute. Be careful what you do.

    Parameters

    • url: string

      The URL that is to be rendered.

    • fileURLs: readonly string[]
    • renderAPI: RenderAPI

      An API of utilities for assisting with the render operation.

    • Optional vmContext: any

      The actual environment that is being setup.

    Returns Promise<undefined | null | ICloseable>

    A promise that the additional setup is done.

  • Get the list of file URLs to retrieve and execute for the given request.

    Parameters

    • url: string

      The URL that is to be rendered.

    • renderAPI: RenderAPI

      An API of utilities for assisting with the render operation.

    • fetchFn: ((url) => undefined | null | Promise<Buffer>)

      Function to fetch a URL. Using this ensures proper tidy-up of associated sockets and agents.

        • (url): undefined | null | Promise<Buffer>
        • Parameters

          • url: string

          Returns undefined | null | Promise<Buffer>

    Returns Promise<string[]>

    An ordered array of absolute URLs for the JavaScript files that are to be executed. These are exectued in the same order as the array.

  • Get a JSDOM resource loader for the given render request.

    Parameters

    • url: string

      The URL that is to be rendered.

    • renderAPI: RenderAPI

      An API of utilities for assisting with the render operation.

    Returns CloseableResourceLoader

    A ResourceLoader instance for use with JSDOM that can optionally have a close() method, which will be invoked when the render completes.

Generated using TypeDoc