<commit_before>import { AnimSnapshot } from './anim-snapshot.js';

/** @typedef {import('./anim-track.js').AnimTrack} AnimTrack */

// TODO: add configurable looping start/end times?

/**
 * AnimClip wraps the running state of an animation track. It contains and update the animation
 * 'cursor' and performs looping logic.
 *
 * @ignore
 */
class AnimClip {
    /**
     * Create a new animation clip.
     *
     * @param {AnimTrack} track - The animation data.
     * @param {number} time - The initial time of the clip.
     * @param {number} speed - Speed of the animation playback.
     * @param {boolean} playing - true if the clip is playing and false otherwise.
     * @param {boolean} loop - Whether the clip should loop.
     * @param {Function} eventHandler - The handler to call when an event is fired by the clip.
     */
    constructor(track, time, speed, playing, loop, eventHandler) {
        this._name = track.name;        // default to track name
        this._track = track;
        this._snapshot = new AnimSnapshot(track);
        this._playing = playing;
        this._time = time;              // play cursor
        this._speed = speed;            // playback speed, may be negative
        this._loop = loop;              // whether to loop
        this._blendWeight = 1.0;        // blend weight 0..1
        this._blendOrder = 0.0;         // blend order relative to other clips
        this._eventHandler = eventHandler;
        this._eventCursor = 0;
        // move the event cursor to an event that should fire after the starting time
        while (this._track.events[this._eventCursor] && this._track.events[this._eventCursor].time < this.time) {
            this._eventCursor++;
        }
    }

    set name(name) {
        this._name = name;
    }<commit_msg>[FIX] Correct type of AnimClip eventHandler parameter (#4166)<commit_after>import { AnimSnapshot } from './anim-snapshot.js';

/** @typedef {import('./anim-track.js').AnimTrack} AnimTrack */
/** @typedef {import('../../core/event-handler.js').EventHandler} EventHandler */

// TODO: add configurable looping start/end times?

/**
 * AnimClip wraps the running state of an animation track. It contains and update the animation
 * 'cursor' and performs looping logic.
 *
 * @ignore
 */
class AnimClip {
    /**
     * Create a new animation clip.
     *
     * @param {AnimTrack} track - The animation data.
     * @param {number} time - The initial time of the clip.
     * @param {number} speed - Speed of the animation playback.
     * @param {boolean} playing - true if the clip is playing and false otherwise.
     * @param {boolean} loop - Whether the clip should loop.
     * @param {EventHandler} [eventHandler] - The handler to call when an event is fired by the clip.
     */
    constructor(track, time, speed, playing, loop, eventHandler) {
        this._name = track.name;        // default to track name
        this._track = track;
        this._snapshot = new AnimSnapshot(track);
        this._playing = playing;
        this._time = time;              // play cursor
        this._speed = speed;            // playback speed, may be negative
        this._loop = loop;              // whether to loop
        this._blendWeight = 1.0;        // blend weight 0..1
        this._blendOrder = 0.0;         // blend order relative to other clips
        this._eventHandler = eventHandler;
        this._eventCursor = 0;
        // move the event cursor to an event that should fire after the starting time
        while (this._track.events[this._eventCursor] && this._track.events[this._eventCursor].time < this.time) {
            this._eventCursor++;
        }
    }

    set name(name) {
        this._name = name;
    }
{'fraction_non_alphanumeric': 0.10798499464094319, 'fraction_numerical': 0.00482315112540193, 'mean_word_length': 2.226447709593777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5808535', 'n_tokens_mistral': 1012, 'n_tokens_neox': 995, 'n_words': 358}