Skip to main content

Class: ServerWindow

Defined in: packages/core/src/window/ServerWindow.ts:10

Server-side implementation of the Window utility API.

Extends

Constructors

new ServerWindow()

new ServerWindow(): ServerWindow

Returns

ServerWindow

Inherited from

Window.constructor

Accessors

$dependencies

Get Signature

get static $dependencies(): never[]

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

Returns

never[]

Methods

bindEventListener()

bindEventListener(): void

Defined in: packages/core/src/window/ServerWindow.ts:194

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


createCustomEvent()

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

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

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

Type Parameters

T

Parameters

name

string

Custom event's name (sometimes referred to as the event's type).

options

CustomEventInit<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


getBody()

getBody(): undefined

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

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


getDocument()

getDocument(): undefined

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

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


getDomain()

getDomain(): ""

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

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

Returns

""

The current domain.

Overrides

Window.getDomain


getElementById()

getElementById(): null

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

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


getHistoryState()

getHistoryState(): undefined

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

Returns the history state.

Returns

undefined

The current history state

Overrides

Window.getHistoryState


getHost()

getHost(): ""

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

Returns

""

The current host.

Overrides

Window.getHost


getPath()

getPath(): ""

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

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


getScrollX()

getScrollX(): 0

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

Returns the number of pixels the viewport is scrolled horizontally.

Returns

0

The number of pixels the viewport is scrolled horizontally.

Overrides

Window.getScrollX


getScrollY()

getScrollY(): 0

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

Returns the number of pixels the document is scrolled vertically.

Returns

0

The number of pixels the document is scrolled vertically.

Overrides

Window.getScrollY


getUrl()

getUrl(): ""

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

Returns

""

The current document's URL.

Overrides

Window.getUrl


getWindow()

getWindow(): undefined

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

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


hasSessionStorage()

hasSessionStorage(): false

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

Returns true if the session storage is supported.

Returns

false

true if the session storage is supported.

Overrides

Window.hasSessionStorage


isClient()

isClient(): false

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

Returns

false

true if invoked at the client side.

Overrides

Window.isClient


isCookieEnabled()

isCookieEnabled(): false

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

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


pushState()

pushState(): void

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

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


querySelector()

querySelector(): null

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

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


querySelectorAll()

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

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

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

Type Parameters

E extends Element = Element

Parameters

selector

string

The CSS selector.

Returns

NodeListOf<E>

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

Overrides

Window.querySelectorAll


redirect()

redirect(): void

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

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

Returns

void

Overrides

Window.redirect


replaceState()

replaceState(): void

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

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


scrollTo()

scrollTo(): void

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

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

Returns

void

Overrides

Window.scrollTo


setTitle()

setTitle(): never

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

Sets the new page title of the document.

Returns

never

Overrides

Window.setTitle


unbindEventListener()

unbindEventListener(): void

Defined in: packages/core/src/window/ServerWindow.ts:201

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