import EventBaseClass from 'domreplay/js/domreplay/eventbaseclass.js'EventBaseClass
Direct Subclass:
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 | 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 | This should be overridden by subclass, and should do the correct replay sequence for the event. | |
| public | Should be called when event is about to be stored. | |
| public | waits for the promise returned by this.store to be resolved. | |
| public | trackElementOnTrail(trail: Object): * 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 Methods
public addDomReplayBorderToElement(element: HTMLElement) source
add border to element.
Params:
| Name | Type | Attribute | Description |
| element | HTMLElement | HTML element. |
public executeTimingRelative(func: *, ratio: float, args: *): Promise source
Executes function after timeout
Params:
| Name | Type | Attribute | Description |
| func | * | function to call | |
| ratio | float | 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:
| Name | Type | Attribute | Description |
| element | HTMLElement |
public makeTrailForElement(element: HTMLElement): * source
make trail for element in HTML DOM.
Params:
| Name | Type | Attribute | Description |
| element | HTMLElement |
Return:
| * |
public removeDomReplayBorderFromElement(element: HTMLElement) source
remove border from element.
Params:
| Name | Type | Attribute | Description |
| element | HTMLElement | 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:
| Name | Type | Attribute | Description |
| eventObject | Object |
public store(eventObject: Object): * | Promise<object> source
Should be called when event is about to be stored.
Params:
| Name | Type | Attribute | Description |
| eventObject | Object |
public async syncStore(eventObject: Object): Promise<object> source
waits for the promise returned by this.store to be resolved.
Params:
| Name | Type | Attribute | Description |
| eventObject | Object |
