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:12

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:191


createCustomEvent

createCustomEvent(name, options): CustomEvent<any> & UnknownParameters

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

See

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

Parameters

NameTypeDescription
namestringCustom event's name (sometimes referred to as the event's type).
optionsUnknownParametersThe custom event's options.

Returns

CustomEvent<any> & UnknownParameters

The created custom event.

Overrides

Window.createCustomEvent

Defined in

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


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:110


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:54


getDomain

getDomain(): string

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

Returns

string

The current domain.

Overrides

Window.getDomain

Defined in

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


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:117


getHistoryState

getHistoryState(): Object

Returns the history state.

Returns

Object

The current history state

Overrides

Window.getHistoryState

Defined in

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


getHost

getHost(): string

Returns

string

The current host.

Overrides

Window.getHost

Defined in

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


getPath

getPath(): string

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

Returns

string

The path and query string parts of the current URL.

Overrides

Window.getPath

Defined in

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


getScrollX

getScrollX(): number

Returns the number of pixels the viewport is scrolled horizontally.

Returns

number

The number of pixels the viewport is scrolled horizontally.

Overrides

Window.getScrollX

Defined in

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


getScrollY

getScrollY(): number

Returns the number of pixels the document is scrolled vertically.

Returns

number

The number of pixels the document is scrolled vertically.

Overrides

Window.getScrollY

Defined in

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


getUrl

getUrl(): string

Returns

string

The current document's URL.

Overrides

Window.getUrl

Defined in

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


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:47


hasSessionStorage

hasSessionStorage(): boolean

Returns true if the session storage is supported.

Returns

boolean

true if the session storage is supported.

Overrides

Window.hasSessionStorage

Defined in

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


isClient

isClient(): boolean

Returns

boolean

true if invoked at the client side.

Overrides

Window.isClient

Defined in

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


isCookieEnabled

isCookieEnabled(): boolean

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

Returns

boolean

true if cookies are handled automatically by the environment.

Overrides

Window.isCookieEnabled

Defined in

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


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:164


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:131


querySelectorAll

querySelectorAll(_selector): DummyNodeList

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

Parameters

NameTypeDescription
_selectorstringThe CSS selector.

Returns

DummyNodeList

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

Overrides

Window.querySelectorAll

Defined in

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


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:157


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:171


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:75


setTitle

setTitle(): void

Sets the new page title of the document.

Returns

void

Overrides

Window.setTitle

Defined in

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


unbindEventListener

unbindEventListener(): void

Deregisters 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:198