"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module RpcInterface
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IModelTileRpcInterface = void 0;
const RpcConstants_1 = require("./core/RpcConstants");
const RpcOperation_1 = require("./core/RpcOperation");
const RpcInterface_1 = require("../RpcInterface");
const RpcManager_1 = require("../RpcManager");
/** @public */
class IModelTileRpcInterface extends RpcInterface_1.RpcInterface {
    static getClient() { return RpcManager_1.RpcManager.getClientForInterface(IModelTileRpcInterface); }
    /** The immutable name of the interface. */
    static interfaceName = "IModelTileRpcInterface";
    /** The semantic version of the interface. */
    static interfaceVersion = "3.2.0";
    /*===========================================================================================
      NOTE: Any add/remove/change to the methods below requires an update of the interface version.
      NOTE: Please consult the README in this folder for the semantic versioning rules.
    ===========================================================================================*/
    /** Get storage config required to download tiles from the tile cache.
     * @returns undefined if the backend does not support caching. In that case, tiles must be requested using [[generateTileContent]].
     * @beta
     */
    async getTileCacheConfig(_tokenProps) {
        const response = await this.forward(arguments);
        return response && { ...response, expiration: new Date(response.expiration) };
    }
    /** @internal */
    async requestTileTreeProps(_tokenProps, _id) { return this.forward(arguments); }
    /** Ask the backend to generate content for the specified tile. This function, unlike the deprecated `requestTileContent`, does not check the cloud storage tile cache -
     * Use `CloudStorageTileCache.retrieve` for that.
     * @returns TileContentSource - if Backend, use retrieveTileContent. If ExternalCache, use TileAdmin.requestCachedTileContent
     * @internal
     */
    async generateTileContent(_rpcProps, _treeId, _contentId, _guid) {
        return this.forward(arguments);
    }
    /** Retrieves tile content from the backend once it's generated by generateTileContent.
     *  @internal
     */
    async retrieveTileContent(_rpcProps, _key) {
        return this.forward(arguments);
    }
    /** @internal */
    async queryVersionInfo() {
        return this.forward(arguments);
    }
    /** This is a temporary workaround for folks developing authoring applications, to be removed when proper support for such applications is introduced.
     * Given a set of model Ids, it purges any associated tile tree state on the back-end so that the next request for the tile tree or content will recreate that state.
     * Invoked after a modification is made to the model(s).
     * If no array of model Ids is supplied, it purges *all* tile trees, which can be quite inefficient.
     * @internal
     */
    async purgeTileTrees(_tokenProps, _modelIds) { return this.forward(arguments); }
    /** Requests graphics for a single element in "iMdl" format.
     * @returns graphics in iMdl format, or `undefined` if the element's geometry produced no graphics or the request was canceled before completion.
     * @throws IModelError on bad request (nonexistent element, duplicate request Id, etc).
     * @internal
     */
    async requestElementGraphics(_rpcProps, _request) {
        return this.forward(arguments);
    }
}
exports.IModelTileRpcInterface = IModelTileRpcInterface;
__decorate([
    RpcOperation_1.RpcOperation.allowResponseCaching(RpcConstants_1.RpcResponseCacheControl.Immutable)
], IModelTileRpcInterface.prototype, "requestTileTreeProps", null);
//# sourceMappingURL=IModelTileRpcInterface.js.map