/* eslint-disable @typescript-eslint/no-extraneous-class */
import { EnvironmentEventTypes } from './EnvironmentEventTypes.js';
import { ContextEvent } from '../BaseEvents.js';
export class EnvironmentEvents {
    /**
     * An event dispatched to set a variable in the current environment.
     *
     * @param name Variable name
     * @param value Variable value
     * @param target A node on which to dispatch the event.
     * @returns Nothing. The promise resolves when the variable is set.
     */
    static async set(name, value, target = window) {
        const detail = { name, value };
        const e = new ContextEvent(EnvironmentEventTypes.set, detail);
        target.dispatchEvent(e);
        return e.detail.result;
    }
}
//# sourceMappingURL=EnvironmentEvents.js.map