import { Cognite3DViewerToolBase } from '../Cognite3DViewerToolBase'; import { Keyframe } from './Keyframe'; import { TimelineDateUpdateDelegate } from './types'; import { CogniteCadModel } from '../../../api'; /** * Tool to applying styles to nodes based on date to play them over in Timeline */ export declare class TimelineTool extends Cognite3DViewerToolBase { private readonly _model; private readonly _keyframes; private _playback; private readonly _events; constructor(cadModel: CogniteCadModel); /** * Subscribe to the Date changed event * @param event `dateChanged` event * @param listener Listen to Timeline date Update during Playback */ subscribe(event: 'dateChanged', listener: TimelineDateUpdateDelegate): void; /** * Unsubscribe to the Date changed event * @param event `dateChanged` event * @param listener Remove Listen to Timeline date Update */ unsubscribe(event: 'dateChanged', listener: TimelineDateUpdateDelegate): void; /** * Create Key frame for the Timeline * @param date - date value by Date.now() since January 1, 1970 */ createKeyframe(date: Date): Keyframe; /** * Returns the keyframe at the date given, or undefined if not found. * @param date * @returns */ getKeyframeByDate(date: Date): Keyframe | undefined; /** * Removes the Keyframe from the timeline. Does nothing if the keyframe isn't part of the timeline. * @param keyframe - Keyframe to be removed from the timeline */ removeKeyframe(keyframe: Keyframe): void; /** * Removes the Keyframe from the Timeline * @param date - Date of the Keyframe to be removed from the Timeline */ removeKeyframeByDate(date: Date): void; /** * Starts playback of Timeline * @param startDate - Keyframe date to start the Playback of Keyframes * @param endDate - Keyframe date to stop the Playback of Keyframes * @param totalDurationInMilliSeconds - Number of milliseconds for all Keyframe within startDate & endDate to be rendered */ play(startDate: Date, endDate: Date, totalDurationInMilliSeconds: number): void; /** * Stops any ongoing playback */ stop(): void; /** * Pause any ongoing playback */ pause(): void; /** * Resume any paused playback */ resume(): void; /** * Provides all Keyframes in the Timeline * @returns All Keyframes in Timeline */ getAllKeyframes(): Keyframe[]; dispose(): void; /** * Sort the Timeline Keyframe by their Date */ private sortKeyframesByDates; }