Function

Static Public Summary
public

Adds an event event listener to the replay update event.

public

Adds an event listener to the state change event.

public

Adds an event listener to the storage update event.

public

Clears the state storage

public

createStateError(message: *): {"type": *, "message": *}

public

createStorageError(message: *): {"type": *, "message": *}

public

Replay update event dispatcher

public

State change event dispatcher.

public

Storage update event dispatcher.

public

Gets the state from localstorage

public

Sets the state to ready.

public

Set state safely to record.

public

Set state safely to replay.

public

True if state is Ready

public

True if state is Record

public

True if state is Replay

public

tracker(trail: *): Promise<HTMLElement>|Promise<null>

Tracks down element according to trail.

public

trail(element: HTMLElement, child: Object, childIndex: Number): Object

Creates a trail according to its ancestors and siblings recursively.

Static Public

public addReplayUpdateEventListener(func: function) source

import {addReplayUpdateEventListener} from 'domreplay/js/domreplay/dispatcher.js'

Adds an event event listener to the replay update event.

Params:

NameTypeAttributeDescription
funcfunction

the function to be called when the event has been dispatched.

public addStateChangeEventListener(func: function) source

import {addStateChangeEventListener} from 'domreplay/js/domreplay/dispatcher.js'

Adds an event listener to the state change event.

Params:

NameTypeAttributeDescription
funcfunction

the function to be called when the event has been dispached.

public addStorageUpdateEventListener(func: function) source

import {addStorageUpdateEventListener} from 'domreplay/js/domreplay/dispatcher.js'

Adds an event listener to the storage update event.

Params:

NameTypeAttributeDescription
funcfunction

the function to be called when the event has been dispatched.

public clearStateStorage() source

import {clearStateStorage} from 'domreplay/js/domreplay/state.js'

Clears the state storage

public createStateError(message: *): {"type": *, "message": *} source

import {createStateError} from 'domreplay/js/domreplay/error.js'

Params:

NameTypeAttributeDescription
message*

Return:

{"type": *, "message": *}

public createStorageError(message: *): {"type": *, "message": *} source

import {createStorageError} from 'domreplay/js/domreplay/error.js'

Params:

NameTypeAttributeDescription
message*

Return:

{"type": *, "message": *}

public dispatchReplayUpdateEventListener(update: Object) source

import {dispatchReplayUpdateEventListener} from 'domreplay/js/domreplay/dispatcher.js'

Replay update event dispatcher

Params:

NameTypeAttributeDescription
updateObject

object with update information

public dispatchStateChangeEvent(state: String) source

import {dispatchStateChangeEvent} from 'domreplay/js/domreplay/dispatcher.js'

State change event dispatcher.

Params:

NameTypeAttributeDescription
stateString

the current state.

public dispatchStorageUpdateEvent(update: Object) source

import {dispatchStorageUpdateEvent} from 'domreplay/js/domreplay/dispatcher.js'

Storage update event dispatcher.

Params:

NameTypeAttributeDescription
updateObject

object with update information.

public getState(): String source

import {getState} from 'domreplay/js/domreplay/state.js'

Gets the state from localstorage

Return:

String

current state

public setStateReady(force: Boolean): * source

import {setStateReady} from 'domreplay/js/domreplay/state.js'

Sets the state to ready. Resolves when state has changed It will reject whenever the current state is not ready.

Params:

NameTypeAttributeDescription
forceBoolean

no safe

Return:

*

public setStateRecord(force: Boolean): Promise source

import {setStateRecord} from 'domreplay/js/domreplay/state.js'

Set state safely to record. Resolves when the state has changed. It will reject whenever the current state is not ready.

Params:

NameTypeAttributeDescription
forceBoolean

no safe

Return:

Promise

Returns a Promise.

public setStateReplay(force: Boolean): Promise source

import {setStateReplay} from 'domreplay/js/domreplay/state.js'

Set state safely to replay. Resolves when the state has changed. It will reject whenever the current state is not ready.

Params:

NameTypeAttributeDescription
forceBoolean

no safe

Return:

Promise

Returns a Promise.

public stateIsReady(): Boolean source

import {stateIsReady} from 'domreplay/js/domreplay/state.js'

True if state is Ready

Return:

Boolean

True if state is Ready

public stateIsRecord(): Boolean source

import {stateIsRecord} from 'domreplay/js/domreplay/state.js'

True if state is Record

Return:

Boolean

True if state is Record

public stateIsReplay(): Boolean source

import {stateIsReplay} from 'domreplay/js/domreplay/state.js'

True if state is Replay

Return:

Boolean

True if state is Replay

public tracker(trail: *): Promise<HTMLElement>|Promise<null> source

Tracks down element according to trail.

Params:

NameTypeAttributeDescription
trail*

Return:

Promise<HTMLElement>|Promise<null>

public trail(element: HTMLElement, child: Object, childIndex: Number): Object source

Creates a trail according to its ancestors and siblings recursively.

Params:

NameTypeAttributeDescription
elementHTMLElement

HTMLElement to make trail of

childObject

child branch.

childIndexNumber

Return:

Object