local ____lualib = require("lualib_bundle")
local Set = ____lualib.Set
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____cachedClasses = require("core.cachedClasses")
local musicManager = ____cachedClasses.musicManager
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____sound = require("functions.sound")
local stopAllSoundEffects = ____sound.stopAllSoundEffects
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {run = {disableSoundSet = __TS__New(Set)}}
____exports.DisableAllSound = __TS__Class()
local DisableAllSound = ____exports.DisableAllSound
DisableAllSound.name = "DisableAllSound"
__TS__ClassExtends(DisableAllSound, Feature)
function DisableAllSound.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.musicWasEnabled = false
    self.postRender = function()
        if v.run.disableSoundSet.size == 0 then
            return
        end
        stopAllSoundEffects(nil)
    end
    self.callbacksUsed = {{ModCallback.POST_RENDER, self.postRender}}
end
function DisableAllSound.prototype.enableAllSound(self, key)
    if not v.run.disableSoundSet:has(key) then
        return
    end
    v.run.disableSoundSet:delete(key)
    if v.run.disableSoundSet.size == 0 and self.musicWasEnabled then
        musicManager:Enable()
    end
    stopAllSoundEffects(nil)
end
__TS__DecorateLegacy({Exported}, DisableAllSound.prototype, "enableAllSound", true)
function DisableAllSound.prototype.disableAllSound(self, key)
    if v.run.disableSoundSet.size == 0 then
        self.musicWasEnabled = musicManager:IsEnabled()
    end
    v.run.disableSoundSet:add(key)
    stopAllSoundEffects(nil)
end
__TS__DecorateLegacy({Exported}, DisableAllSound.prototype, "disableAllSound", true)
return ____exports
