"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.readAssetsMap = exports.readAssetsMapSync = exports.loadConfig = exports.getBoatmanBundlePathSync = exports.getBoatmanBundlePath = exports.generateInjectCodePathSync = exports.generateInjectCodePath = exports.generateInjectCodeSync = exports.generateInjectCode = exports.updateInjectCodeAssets = void 0;
const sdk_1 = require("./sdk");
let sharedBuilderDebugClient;
function getClient() {
    if (!sharedBuilderDebugClient) {
        sharedBuilderDebugClient = new sdk_1.BuilderDebugClient();
    }
    return sharedBuilderDebugClient;
}
function updateInjectCodeAssets(options = {}) {
    return __awaiter(this, void 0, void 0, function* () {
        return getClient().updateOfflineAssets(options);
    });
}
exports.updateInjectCodeAssets = updateInjectCodeAssets;
function generateInjectCode(options) {
    return __awaiter(this, void 0, void 0, function* () {
        return getClient().generateInjectCode(options);
    });
}
exports.generateInjectCode = generateInjectCode;
function generateInjectCodeSync(options) {
    return getClient().generateInjectCodeSync(options);
}
exports.generateInjectCodeSync = generateInjectCodeSync;
function generateInjectCodePath(options) {
    return __awaiter(this, void 0, void 0, function* () {
        return getClient().generateInjectCodePath(options);
    });
}
exports.generateInjectCodePath = generateInjectCodePath;
function generateInjectCodePathSync(options) {
    return getClient().generateInjectCodePathSync(options);
}
exports.generateInjectCodePathSync = generateInjectCodePathSync;
function getBoatmanBundlePath(options = {}) {
    return __awaiter(this, void 0, void 0, function* () {
        return getClient().getBoatmanBundlePath(options);
    });
}
exports.getBoatmanBundlePath = getBoatmanBundlePath;
function getBoatmanBundlePathSync(options = {}) {
    return getClient().getBoatmanBundlePathSync(options);
}
exports.getBoatmanBundlePathSync = getBoatmanBundlePathSync;
function loadConfig(options) {
    sharedBuilderDebugClient = new sdk_1.BuilderDebugClient(options);
}
exports.loadConfig = loadConfig;
function readAssetsMapSync() {
    return getClient().readAssetsMapSync();
}
exports.readAssetsMapSync = readAssetsMapSync;
function readAssetsMap() {
    return getClient().readAssetsMap();
}
exports.readAssetsMap = readAssetsMap;
