@itwin/presentation-backend
Version:
Backend of iTwin.js Presentation library
25 lines • 1.3 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
*/
import { IpcHandler } from "@itwin/core-backend";
import { RulesetVariable } from "@itwin/presentation-common";
import { PRESENTATION_IPC_CHANNEL_NAME } from "@itwin/presentation-common/internal";
import { Presentation } from "./Presentation.js";
/** @internal */
export class PresentationIpcHandler extends IpcHandler {
channelName = PRESENTATION_IPC_CHANNEL_NAME;
async setRulesetVariable(params) {
const { clientId, rulesetId, variable } = params;
const parsedVariable = RulesetVariable.fromJSON(variable);
Presentation.getManager(clientId).vars(rulesetId).setValue(parsedVariable.id, parsedVariable.type, parsedVariable.value);
}
async unsetRulesetVariable(params) {
const { clientId, rulesetId, variableId } = params;
Presentation.getManager(clientId).vars(rulesetId).unset(variableId);
}
}
//# sourceMappingURL=PresentationIpcHandler.js.map