constructor() {
        super();
        /**
         * When parsing, set to current tick.
         */
        this.currentTick = -1;
        /**
         * Number of seconds per tick
         */
        this.tickInterval = NaN;
        /**
         * When parsing, set to the splitscreen slot for the current command.
         * @deprecated Splitscreen slot is unused for PC games.
         */
        this.playerSlot = 0;
        /**
         * Set to the client slot of the recording player.
         * Always null for GOTV demos.
         */
        this.recordingClientSlot = null;
        this._chunks = [];
        this._lastThreadYieldTime = 0;
        this._immediateTimerToken = null;
        this._timeoutTimerToken = null;
        this._encryptionKey = null;
        this._hasEnded = false;
        this._isBroadcastFragment = false;
        this._supplementEvents = [
            grenadetrajectory_1.default,
            molotovdetonate_1.default,
            itempurchase_1.default
        ];
        this._supplementCleanupFns = new Map();
        this.entities = new entities_1.Entities();
        this.gameEvents = new gameevents_1.GameEvents();
        this.stringTables = new stringtables_1.StringTables();
        this.userMessages = new usermessages_1.UserMessages();
        this.conVars = new convars_1.ConVars();
        this.gameEvents.listen(this);
        // It is important that entities listens after game events, as they both listen on
        // tickend.
        this.entities.listen(this);
        this.stringTables.listen(this);
        this.userMessages.listen(this);
        this.conVars.listen(this);
        // #65: Some demos are missing playbackTicks from the header
        // Pull the tick interval from ServerInfo
        this.on("svc_ServerInfo", msg => {
            this.tickInterval = msg.tickInterval;
        });
        this.on("svc_EncryptedData", msg => {
            if (!this._handleEncryptedData(msg)) {
                // Some demos appear to have the encryption key recorded
                // incorrectly in the .dem.info file. Don't throw an error
                // if we can't decode it correctly.
                // The game client silently skips bad encrypted messages.
                // See https://github.com/saul/demofile/issues/322#issuecomment-1085776379
                this.emit("warning", { message: "Unable to read encrypted message" });
            }
        });
        this.on("newListener", (event) => {
            // If we already have listeners for this event, nothing to do
            if (this.listenerCount(event) > 0)
                return;
            const supplement = this._findSupplement(event);
            if (supplement == null)
                return;
            const cleanupFn = supplement.setup(this);
            this._supplementCleanupFns.set(supplement, cleanupFn);
        });
        this.on("removeListener", (event) => {
            // If there are still listeners for this event, early out
            if (this.listenerCount(event) > 0)
                return;
            const supplement = this._findSupplement(event);
            if (supplement == null)
                return;
            // Don't cleanup if there are listeners on other emits that this supplement emits
            const existingListenerCount = supplement.emits.reduce((prev, name) => prev + this.listenerCount(name), 0);
            if (existingListenerCount > 0)
                return;
            const cleanupFn = (0, assert_exists_1.default)(this._supplementCleanupFns.get(supplement));
            cleanupFn();
            this._supplementCleanupFns.delete(supplement);
        });
    }
Starts parsing buffer as a demo file.

@fires DemoFile#tickstart
@fires DemoFile#tickend
@fires DemoFile#end

@param {ArrayBuffer} buffer - Buffer pointing to start of demo header