-- Compiled with roblox-ts v1.3.3
warn("This Lazy class should not be used anymore! Switch to @rbxts/lazy")
--[[
	*
	* Lazy-loads a value and stores that value for the rest of the instance's lifetime
]]
local Lazy
do
	Lazy = setmetatable({}, {
		__tostring = function()
			return "Lazy"
		end,
	})
	Lazy.__index = Lazy
	function Lazy.new(...)
		local self = setmetatable({}, Lazy)
		return self:constructor(...) or self
	end
	function Lazy:constructor(loadCallback)
		self.loadCallback = loadCallback
		self.hasValueBeenLoaded = false
	end
	function Lazy:getValue()
		if not self.hasValueBeenLoaded then
			self.value = self.loadCallback()
			self.hasValueBeenLoaded = true
		end
		-- Needs the `as T` to make TypeScript ignore that
		-- `this.value`'s type is `T | undefined` at this point
		-- `hasValueBeenLoaded` will control that
		return self.value
	end
end
return {
	Lazy = Lazy,
}
