@itwin/frontend-devtools
Version:
Debug menu and supporting UI widgets
27 lines • 1.25 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 Tools
*/
import { BeDuration } from "@itwin/core-bentley";
import { IModelApp, Tool } from "@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
*/
export class AnimationIntervalTool extends Tool {
static toolId = "AnimationInterval";
static get minArgs() { return 1; }
static get maxArgs() { return 1; }
async run(interval) {
IModelApp.animationInterval = interval;
return true;
}
async parseAndRun(...args) {
const millis = Number.parseInt(args[0], 10);
const interval = !Number.isNaN(millis) ? BeDuration.fromMilliseconds(millis) : undefined;
return this.run(interval);
}
}
//# sourceMappingURL=AnimationIntervalTool.js.map