@itwin/frontend-devtools
Version:
Debug menu and supporting UI widgets
31 lines • 1.47 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnimationIntervalTool = void 0;
/** @packageDocumentation
* @module Tools
*/
const core_bentley_1 = require("@itwin/core-bentley");
const core_frontend_1 = require("@itwin/core-frontend");
/** Changes the [IModelApp.animationInterval]($frontend). Specify the interval in integer milliseconds; or pass any string not parseable as an integer to disable the animation interval callback.
* @beta
*/
class AnimationIntervalTool extends core_frontend_1.Tool {
static toolId = "AnimationInterval";
static get minArgs() { return 1; }
static get maxArgs() { return 1; }
async run(interval) {
core_frontend_1.IModelApp.animationInterval = interval;
return true;
}
async parseAndRun(...args) {
const millis = Number.parseInt(args[0], 10);
const interval = !Number.isNaN(millis) ? core_bentley_1.BeDuration.fromMilliseconds(millis) : undefined;
return this.run(interval);
}
}
exports.AnimationIntervalTool = AnimationIntervalTool;
//# sourceMappingURL=AnimationIntervalTool.js.map