function Loader(baseUrl, concurrency) {
        var _this = this;
        if (baseUrl === void 0) { baseUrl = ''; }
        if (concurrency === void 0) { concurrency = 10; }
        /** The progress percent of the loader going through the queue. */
        this.progress = 0;
        /** Loading state of the loader, true if it is currently loading resources. */
        this.loading = false;
        /**
         * A querystring to append to every URL added to the loader.
         *
         * This should be a valid query string *without* the question-mark (`?`). The loader will
         * also *not* escape values for you. Make sure to escape your parameters with
         * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.
         * @example
         * const loader = new Loader();
         *
         * loader.defaultQueryString = 'user=me&password=secret';
         *
         * // This will request 'image.png?user=me&password=secret'
         * loader.add('image.png').load();
         *
         * loader.reset();
         *
         * // This will request 'image.png?v=1&user=me&password=secret'
         * loader.add('iamge.png?v=1').load();
         */
        this.defaultQueryString = '';
        /** The middleware to run before loading each resource. */
        this._beforeMiddleware = [];
        /** The middleware to run after loading each resource. */
        this._afterMiddleware = [];
        /** The tracks the resources we are currently completing parsing for. */
        this._resourcesParsing = [];
        /**
         * The `_loadResource` function bound with this object context.
         * @param r - The resource to load
         * @param d - The dequeue function
         */
        this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };
        /** All the resources for this loader keyed by name. */
        this.resources = {};
        this.baseUrl = baseUrl;
        this._beforeMiddleware = [];
        this._afterMiddleware = [];
        this._resourcesParsing = [];
        this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };
        this._queue = AsyncQueue.queue(this._boundLoadResource, concurrency);
        this._queue.pause();
        this.resources = {};
        this.onProgress = new Signal();
        this.onError = new Signal();
        this.onLoad = new Signal();
        this.onStart = new Signal();
        this.onComplete = new Signal();
        for (var i = 0; i < Loader._plugins.length; ++i) {
            var plugin = Loader._plugins[i];
            var pre = plugin.pre, use = plugin.use;
            if (pre) {
                this.pre(pre);
            }
            if (use) {
                this.use(use);
            }
        }
        this._protected = false;
    }
@param baseUrl - The base url for all resources loaded by this loader.
@param concurrency - The number of resources to load concurrently.