Skip to main content

Class: ServerWindow

@ima/core.ServerWindow

Server-side implementation of the Window utility API.

Hierarchy

Constructors

constructor

new ServerWindow()

Inherited from

Window.constructor

Accessors

$dependencies

Static get $dependencies(): never[]

Returns

never[]

Defined in

packages/core/src/window/ServerWindow.ts:11

Methods

bindEventListener

bindEventListener(): void

Registers the provided event listener to be executed when the specified event occurs on the specified event target.

Registering the same event listener for the same event on the same event target with the same useCapture flag value repeatedly has no effect.

Returns

void

Overrides

Window.bindEventListener

Defined in

packages/core/src/window/ServerWindow.ts:195


createCustomEvent

createCustomEvent<T>(name, options): CustomEvent<T>

Create new instance of CustomEvent of the specified name and using the provided options.

Type parameters

Name
T

Parameters

NameTypeDescription
namestringCustom event's name (sometimes referred to as the event's type).
optionsCustomEventInit<T>The custom event's options.

Returns

CustomEvent<T>

The created custom event.

See

https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent

Overrides

Window.createCustomEvent

Defined in

packages/core/src/window/ServerWindow.ts:179


getBody

getBody(): undefined

Returns the document's body element. The method returns undefined if invoked at the server-side.

Returns

undefined

The document's body element, or undefined if invoked at the server side.

Overrides

Window.getBody

Defined in

packages/core/src/window/ServerWindow.ts:109


getDocument

getDocument(): undefined

Returns the native document object representing any web page loaded in the browser and serves as an entry point into the web page's content which is the DOM tree at the client-side. The method returns undefined if used at the server-side.

Returns

undefined

The document object at the client-side, or undefined at the server-side.

Overrides

Window.getDocument

Defined in

packages/core/src/window/ServerWindow.ts:53


getDomain

getDomain(): ""

Returns the domain of the current document's URL as ${protocol}://${host}.

Returns

""

The current domain.

Overrides

Window.getDomain

Defined in

packages/core/src/window/ServerWindow.ts:81


getElementById

getElementById(): null

Returns the HTML element with the specified id attribute value.

Returns

null

The element with the specified id, or null if no such element exists.

Overrides

Window.getElementById

Defined in

packages/core/src/window/ServerWindow.ts:116


getHistoryState

getHistoryState(): undefined

Returns the history state.

Returns

undefined

The current history state

Overrides

Window.getHistoryState

Defined in

packages/core/src/window/ServerWindow.ts:123


getHost

getHost(): ""

Returns

""

The current host.

Overrides

Window.getHost

Defined in

packages/core/src/window/ServerWindow.ts:88


getPath

getPath(): ""

Returns the path part of the current URL, including the query string.

Returns

""

The path and query string parts of the current URL.

Overrides

Window.getPath

Defined in

packages/core/src/window/ServerWindow.ts:95


getScrollX

getScrollX(): 0

Returns the number of pixels the viewport is scrolled horizontally.

Returns

0

The number of pixels the viewport is scrolled horizontally.

Overrides

Window.getScrollX

Defined in

packages/core/src/window/ServerWindow.ts:60


getScrollY

getScrollY(): 0

Returns the number of pixels the document is scrolled vertically.

Returns

0

The number of pixels the document is scrolled vertically.

Overrides

Window.getScrollY

Defined in

packages/core/src/window/ServerWindow.ts:67


getUrl

getUrl(): ""

Returns

""

The current document's URL.

Overrides

Window.getUrl

Defined in

packages/core/src/window/ServerWindow.ts:102


getWindow

getWindow(): undefined

Returns the native window object representing the global context at the client-side. The method returns undefined if used at the server-side.

Returns

undefined

The window object at the client-side, or undefined at the server-side.

Overrides

Window.getWindow

Defined in

packages/core/src/window/ServerWindow.ts:46


hasSessionStorage

hasSessionStorage(): false

Returns true if the session storage is supported.

Returns

false

true if the session storage is supported.

Overrides

Window.hasSessionStorage

Defined in

packages/core/src/window/ServerWindow.ts:32


isClient

isClient(): false

Returns

false

true if invoked at the client side.

Overrides

Window.isClient

Defined in

packages/core/src/window/ServerWindow.ts:18


isCookieEnabled

isCookieEnabled(): false

Returns true if the cookies are set and processed with every HTTP request and response automatically by the environment.

Returns

false

true if cookies are handled automatically by the environment.

Overrides

Window.isCookieEnabled

Defined in

packages/core/src/window/ServerWindow.ts:25


pushState

pushState(): void

Pushes a new state to the browser history. The method has no effect if the current browser does not support the history API (IE9).

Returns

void

Overrides

Window.pushState

Defined in

packages/core/src/window/ServerWindow.ts:165


querySelector

querySelector(): null

Returns the first element matching the specified CSS 3 selector.

Returns

null

The first element matching the CSS selector or null if no such element exists.

Overrides

Window.querySelector

Defined in

packages/core/src/window/ServerWindow.ts:130


querySelectorAll

querySelectorAll<E>(selector): NodeListOf<E>

Returns a node list of all elements matching the specified CSS 3 selector.

Type parameters

NameType
Eextends Element = Element

Parameters

NameTypeDescription
selectorstringThe CSS selector.

Returns

NodeListOf<E>

A node list containing all elements matching the specified CSS selector.

Overrides

Window.querySelectorAll

Defined in

packages/core/src/window/ServerWindow.ts:137


redirect

redirect(): void

Performs a hard redirect (discarding the current JavaScript state) to the specified URL.

Returns

void

Overrides

Window.redirect

Defined in

packages/core/src/window/ServerWindow.ts:158


replaceState

replaceState(): void

Replaces the current history entry. The method has no effect if the current browser does not support the history API (IE9).

Returns

void

Overrides

Window.replaceState

Defined in

packages/core/src/window/ServerWindow.ts:172


scrollTo

scrollTo(): void

Scrolls the viewport to the specified location (if possible).

Returns

void

Overrides

Window.scrollTo

Defined in

packages/core/src/window/ServerWindow.ts:74


setTitle

setTitle(): never

Sets the new page title of the document.

Returns

never

Overrides

Window.setTitle

Defined in

packages/core/src/window/ServerWindow.ts:39


unbindEventListener

unbindEventListener(): void

Deregister the provided event listener, so it will no longer we executed when the specified event occurs on the specified event target.

The method has no effect if the provided event listener is not registered to be executed at the specified event.

Returns

void

Overrides

Window.unbindEventListener

Defined in

packages/core/src/window/ServerWindow.ts:202