import EventBaseClass from 'domreplay/js/domreplay/eventbaseclass.js'
public class |source

EventBaseClass

Direct Subclass:

ClickEvent, CustomInputEvent

Extend this when implementing custom events that should be recorded/replayed.

Static Member Summary

Static Public Members
public static

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get abstract

Should return a string with event type, needs to be overridden by subclass.

public set

replaySpeed(divider: *)

Replay speed.

public get abstract

Should return a list og tagnames which handlers should be subscribed to.

public set

Sets the replay timing variable.

public get

Gets the timing variable

public set

trackerFunc(trackerFunc: function)

set tracker function.

public set

trailFunc(trailFunc: function)

Set trail function

Method Summary

Public Methods
public

addDomReplayBorderToElement(element: HTMLElement)

add border to element.

public

executeTimingRelative(func: *, ratio: float, args: *): Promise

Executes function after timeout

public

Gets the last stored event from storage.

public abstract

handler(element: HTMLElement)

This is handler called when event is dispatched.

public

makeTrailForElement(element: HTMLElement): *

make trail for element in HTML DOM.

public

removeDomReplayBorderFromElement(element: HTMLElement)

remove border from element.

public abstract

replay(eventObject: Object)

This should be overridden by subclass, and should do the correct replay sequence for the event.

public

store(eventObject: Object): * | Promise<object>

Should be called when event is about to be stored.

public

async syncStore(eventObject: Object): Promise<object>

waits for the promise returned by this.store to be resolved.

public

track element in HTML DOM by trail.

public

updateLastStored(updates: Object): *

Merge update the last stored event, useful when recording input events and such.

Static Public Members

public static DOM_REPLAY_BORDER_CLASS: * source

Public Constructors

public constructor() source

Public Members

public get abstract eventType source

Should return a string with event type, needs to be overridden by subclass.

public set replaySpeed(divider: *) source

Replay speed. 2.0 is twice as fast.

public get abstract tagnames source

Should return a list og tagnames which handlers should be subscribed to.

public set timing(ms: Number) source

Sets the replay timing variable.

public get timing: number: * source

Gets the timing variable

Return:

number

gets the timing.

public set trackerFunc(trackerFunc: function) source

set tracker function.

public set trailFunc(trailFunc: function) source

Set trail function

Public Methods

public addDomReplayBorderToElement(element: HTMLElement) source

add border to element.

Params:

NameTypeAttributeDescription
elementHTMLElement

HTML element.

public executeTimingRelative(func: *, ratio: float, args: *): Promise source

Executes function after timeout

Params:

NameTypeAttributeDescription
func*

function to call

ratiofloat

relative to timing.

args*

arguments to be passed to the passed function.

Return:

Promise

resolves with function return value after function has been executed.

public getLastStored(): Object source

Gets the last stored event from storage.

Return:

Object

an object of the last stored event.

public abstract handler(element: HTMLElement) source

This is handler called when event is dispatched. Should be overridden by subclass and store event to storage.

Params:

NameTypeAttributeDescription
elementHTMLElement

public makeTrailForElement(element: HTMLElement): * source

make trail for element in HTML DOM.

Params:

NameTypeAttributeDescription
elementHTMLElement

Return:

*

public removeDomReplayBorderFromElement(element: HTMLElement) source

remove border from element.

Params:

NameTypeAttributeDescription
elementHTMLElement

HTML element.

public abstract replay(eventObject: Object) source

This should be overridden by subclass, and should do the correct replay sequence for the event.

Params:

NameTypeAttributeDescription
eventObjectObject

public store(eventObject: Object): * | Promise<object> source

Should be called when event is about to be stored.

Params:

NameTypeAttributeDescription
eventObjectObject

Return:

* | Promise<object>

public async syncStore(eventObject: Object): Promise<object> source

waits for the promise returned by this.store to be resolved.

Params:

NameTypeAttributeDescription
eventObjectObject

Return:

Promise<object>

public trackElementOnTrail(trail: Object): * source

track element in HTML DOM by trail.

Params:

NameTypeAttributeDescription
trailObject

Return:

*

public updateLastStored(updates: Object): * source

Merge update the last stored event, useful when recording input events and such.

Params:

NameTypeAttributeDescription
updatesObject

update object.

Return:

*