// This Source Code Form is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
export class CallbackManager {
    #callbacks = [];
    add(callback) {
        this.#callbacks.push(callback);
    }
    remove(callback) {
        const index = this.#callbacks.indexOf(callback);
        if (index !== -1) {
            this.#callbacks.splice(index, 1);
        }
    }
    fire(data) {
        for (const callback of this.#callbacks) {
            callback(data);
        }
    }
}
//# sourceMappingURL=callback-manager.js.map