transformTo(type = this._type) {
            if (!this.loaded) {
                this._conversionJobQueue = this._conversionJobQueue || [];
                let resolver = null;
                const promise = new $.Promise((resolve, reject) => {
                    resolver = resolve;
                });

                // Todo consider submitting only single tranform job to queue: any other transform calls will have
                //  no effect, the last one decides the target format
                this._conversionJobQueue.push(() => {
                    if (this._destroyed) {
                        return;
                    }
                    //must re-check types since we perform in a queue of conversion requests
                    if ((typeof type === "string" && type !== this._type) || (Array.isArray(type) && !type.includes(this._type))) {
                        //ensures queue gets executed after finish
                        this._convert(this._type, type);
                        this._promise.then(data => resolver(data));
                    } else {
                        //must ensure manually, but after current promise finished, we won't wait for the following job
                        this._promise.then(data => {
                            this._checkAwaitsConvert();
                            return resolver(data);
                        });
                    }
                });
                return promise;
            }

            if ((typeof type === "string" && type !== this._type) || (Array.isArray(type) && !type.includes(this._type))) {
                this._convert(this._type, type);
            }
            return this._promise;
        }
Transform cache to desired type and get the data after conversion.
Does nothing if the type equals to the current type. Asynchronous.
Transformation is LAZY, meaning conversions are performed only to
match the last conversion request target type.
@param {string|string[]} type if array provided, the system will
  try to optimize for the best type to convert to.
@return {OpenSeadragon.Promise<?>}