add metadata, getElement method

This commit is contained in:
Miodec 2025-12-25 00:15:01 +01:00
parent 872250a769
commit 4521dc7301

View file

@ -41,13 +41,20 @@ export class Caret {
private marginTopAnimation: JSAnimation | null = null;
private marginLeftAnimation: JSAnimation | null = null;
constructor(element: ElementWithUtils, style: CaretStyle) {
metadata: Record<string, string> = {};
constructor(element: ElementWithUtils, style: CaretStyle, metadata = {}) {
this.id = element.native.id;
this.element = element;
this.setStyle(style);
if (this.id === "caret") {
this.isMainCaret = true;
}
this.metadata = metadata;
}
public getElement(): ElementWithUtils {
return this.element;
}
public setStyle(style: CaretStyle): void {