import { Property } from '../property.js';

export class Cursor extends Property {
    public static Default = new Cursor('default');
    public static Pointer = new Cursor('pointer');

    #value: string;

    private constructor(value: string) {
        super();

        this.#value = value;
    }

    public override equals(other: Property): boolean {
        if (!(other instanceof Cursor)) return false;

        return other.#value === this.#value;
    }

    public override apply(element: HTMLElement): void {
        element.style.cursor = this.#value;
    }

    public override inspect(indent: number): string {
        return `Cursor { ${this.#value} }`;
    }
}
