import { __awaiter, __generator } from "tslib";
var isReady = false;
var awaitingReady = [];
export function whenWorkletReady() {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            if (!isReady) {
                return [2, new Promise(function (resolve) {
                        awaitingReady.push(resolve);
                    })];
            }
            return [2];
        });
    });
}
function flushAwaiting() {
    awaitingReady.forEach(function (resolve) { return resolve(); });
}
export function workletReady() {
    isReady = true;
    flushAwaiting();
}
//# sourceMappingURL=load-worklet.js.map