local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____cachedClasses = require("core.cachedClasses")
local game = ____cachedClasses.game
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {room = {cleared = false}}
____exports.PostRoomClearChanged = __TS__Class()
local PostRoomClearChanged = ____exports.PostRoomClearChanged
PostRoomClearChanged.name = "PostRoomClearChanged"
__TS__ClassExtends(PostRoomClearChanged, CustomCallback)
function PostRoomClearChanged.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = function(____, fireArgs, optionalArgs)
        local roomClear = table.unpack(fireArgs)
        local callbackRoomClear = table.unpack(optionalArgs)
        return callbackRoomClear == nil or callbackRoomClear == roomClear
    end
    self.postUpdate = function()
        local room = game:GetRoom()
        local roomClear = room:IsClear()
        if roomClear ~= v.room.cleared then
            v.room.cleared = roomClear
            self:fire(roomClear)
        end
    end
    self.postNewRoomReordered = function()
        local room = game:GetRoom()
        local roomClear = room:IsClear()
        v.room.cleared = roomClear
    end
    self.callbacksUsed = {{ModCallback.POST_UPDATE, self.postUpdate}}
    self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}}
end
return ____exports
