@itwin/presentation-backend
Version:
Backend of iTwin.js Presentation library
29 lines • 1.55 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module RPC
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PresentationIpcHandler = void 0;
const core_backend_1 = require("@itwin/core-backend");
const presentation_common_1 = require("@itwin/presentation-common");
const internal_1 = require("@itwin/presentation-common/internal");
const Presentation_js_1 = require("./Presentation.js");
/** @internal */
class PresentationIpcHandler extends core_backend_1.IpcHandler {
channelName = internal_1.PRESENTATION_IPC_CHANNEL_NAME;
async setRulesetVariable(params) {
const { clientId, rulesetId, variable } = params;
const parsedVariable = presentation_common_1.RulesetVariable.fromJSON(variable);
Presentation_js_1.Presentation.getManager(clientId).vars(rulesetId).setValue(parsedVariable.id, parsedVariable.type, parsedVariable.value);
}
async unsetRulesetVariable(params) {
const { clientId, rulesetId, variableId } = params;
Presentation_js_1.Presentation.getManager(clientId).vars(rulesetId).unset(variableId);
}
}
exports.PresentationIpcHandler = PresentationIpcHandler;
//# sourceMappingURL=PresentationIpcHandler.js.map
;