Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Trove
-- Stephen Leitnick
-- October 16, 2021



local FN_MARKER = newproxy()
local THREAD_MARKER = newproxy()

local RunService = game:GetService("RunService")

local function GetObjectCleanupFunction(object, cleanupMethod)
	local t = typeof(object)
	if t == "function" then
		return FN_MARKER
	elseif t == "thread" then
		return THREAD_MARKER
	end
	if cleanupMethod then
		return cleanupMethod
	end
	if t == "Instance" then
		return "Destroy"
	elseif t == "RBXScriptConnection" then
		return "Disconnect"
	elseif t == "table" then
		if typeof(object.Destroy) == "function" then
			return "Destroy"
		elseif typeof(object.Disconnect) == "function" then
			return "Disconnect"
		end
	end
	error("Failed to get cleanup function for object " .. t .. ": " .. tostring(object), 3)
end

local function AssertPromiseLike(object)
	if
		typeof(object) ~= "table"
		or typeof(object.getStatus) ~= "function"
		or typeof(object.finally) ~= "function"
		or typeof(object.cancel) ~= "function"
	then
		error("Did not receive a Promise as an argument", 3)
	end
end
--repeat wait() until Character:FindFirstChild("Humanoid")


local Humanoid = Character:WaitForChild("Humanoid");

local LastJump = time();
Humanoid.Changed:connect(function()
	if Humanoid.Jump then
		if time()-LastJump >= TimeBetweenJumps then
			LastJump = time();
		else
			Humanoid.Jump = false;
		end
	end
end)

print("Done")
-- Invisible --


local tweenHE = TweenService:Create(head, tweenInfo, goal)
local tweenBT = TweenService:Create(button, tweenInfo, goal)
local tweenIH = TweenService:Create(innerHead, tweenInfo, goal)
local tweenIE = TweenService:Create(innerEars, tweenInfo, goal)
local tweenE = TweenService:Create(ears, tweenInfo, goal)
local tweenC = TweenService:Create(cap, tweenInfo, goal)
local tweenLF = TweenService:Create(lFang, tweenInfo, goal)
local tweenRF = TweenService:Create(rFang, tweenInfo, goal)
local tweenLA = TweenService:Create(lArm, tweenInfo, goal)
local tweenRA = TweenService:Create(rArm, tweenInfo, goal)
local tweenT = TweenService:Create(t, tweenInfo, goal)
local tweenLW = TweenService:Create(lWing, tweenInfo, goal)
local tweenRW = TweenService:Create(rWing, tweenInfo, goal)
local tweenLTA = TweenService:Create(lTA, tweenInfo, goal)
local tweenRTA = TweenService:Create(rTA, tweenInfo, goal)
local tweenLL = TweenService:Create(lLeg, tweenInfo, goal)
local tweenRL = TweenService:Create(rLeg, tweenInfo, goal)
local tweenB = TweenService:Create(bow, tweenInfo, goal)
local tweenBB = TweenService:Create(bb, tweenInfo, goal)
local tweenFA = TweenService:Create(fa, tweenInfo, goal)
--[[
	Returns an iterator over the children of an element.
	`elementOrElements` may be one of:
	* a boolean
	* nil
	* a single element
	* a fragment
	* a table of elements

	If `elementOrElements` is a boolean or nil, this will return an iterator with
	zero elements.

	If `elementOrElements` is a single element, this will return an iterator with
	one element: a tuple where the first value is ElementUtils.UseParentKey, and
	the second is the value of `elementOrElements`.

	If `elementOrElements` is a fragment or a table, this will return an iterator
	over all the elements of the array.

	If `elementOrElements` is none of the above, this function will throw.
]]


function ElementUtils.iterateElements(elementOrElements)
	local richType = Type.of(elementOrElements)

	if richType == Type.Fragment then
		return pairs(elementOrElements.elements)
	end

	-- Single child
	if richType == Type.Element then
		local called = false

		return function()
			if called then
				return nil
			else
				called = true
				return ElementUtils.UseParentKey, elementOrElements
			end
		end
	end

	local regularType = typeof(elementOrElements)

	if elementOrElements == nil or regularType == "boolean" then
		return noop
	end

	if regularType == "table" then
		return pairs(elementOrElements)
	end

	error("Invalid elements")
end
--[=[
	@return Shake
	Creates a new shake with identical properties as
	this one. This does _not_ clone over playing state,
	and thus the cloned instance will be in a stopped
	state.

	A use-case for using `Clone` would be to create a module
	with a list of shake presets. These presets can be cloned
	when desired for use. For instance, there might be presets
	for explosions, recoil, or earthquakes.

	```lua
	--------------------------------------
	-- Example preset module
	local ShakePresets = {}

	local explosion = Shake.new()
	-- Configure `explosion` shake here
	ShakePresets.Explosion = explosion

	return ShakePresets
	--------------------------------------

	-- Use the module:
	local ShakePresets = require(somewhere.ShakePresets)
	local explosionShake = ShakePresets.Explosion:Clone()
	```
]=]


function Shake:Clone()
	local shake = Shake.new()
	local cloneFields = {
		"Amplitude",
		"Frequency",
		"FadeInTime",
		"FadeOutTime",
		"SustainTime",
		"Sustain",
		"PositionInfluence",
		"RotationInfluence",
		"TimeFunction",
	}
	for _, field in cloneFields do
		shake[field] = self[field]
	end
	return shake
end
--!strict
--[=[
	@function pop
	@within Array

	@param array {T} -- The array to pop an element from.
	@param count? number = 1 -- The number of elements to pop.
	@return {T} -- An array with the popped elements removed.

	Removes an element from the end of the array, and returns
	the array with the popped elements removed.

	```lua
	local array = { 1, 2, 3 }

	local new = Pop(array) -- { 1, 2 }
	local new = Pop(array, 2) -- { 1 }
	```
]=]


local function pop<T>(array: { T }, count: number?): { T }
	local length = #array
	local result = {}

	count = if type(count) == "number" then count else 1

	for i = 1, length - count do
		table.insert(result, array[i])
	end

	return result
end

return pop
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled 
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	Tune.FSpringOffset	= {			-- Suspension anchor point offset (relative to ABOVE anchor offset) (Avxnturador)
	 --[[Lateral]]		0		,	-- positive = outward 
	 --[[Vertical]]		0		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	Tune.RSpringOffset	= {			-- Suspension anchor point offset (relative to ABOVE anchor offset) (Avxnturador)
	 --[[Lateral]]		0		,	-- positive = outward 
	 --[[Vertical]]		0		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 200		-- Spring Dampening
	Tune.FSusStiffness	= 7000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 5 		-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3	   	-- Max Extension Travel (in studs)
	Tune.FCompressLim	= 3  		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 200		-- Spring Dampening
	Tune.RSusStiffness	= 8000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 5.5 		-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .5 		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= 4 		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .7    		-- Suspension Coil Thickness
	Tune.SusColor		= "Fossil"      -- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .6			-- Wishbone Rod Thickness
-- returns angle' closest to referenceAngle or 0 such that rotation(angle') == rotation(angle)


function MathUtils:AngleNormalize(angle, referenceAngle)
    referenceAngle = referenceAngle or 0
    return (angle - referenceAngle + PI)%TAU - PI + referenceAngle
end

function MathUtils:AngleShortest(a0, a1)
    return self:AngleNormalize(a1 - a0)
end

function MathUtils:LerpAngle(a0, a1, frac)
    return a0 + self:AngleShortest(a0, a1) * frac
end
-- events



REMOTES.RocketLauncher.OnServerEvent:connect(function(player, item, action, ...)
	local character	= player.Character
	local ammo		= character.Ammo
	local equipped	= character.Equipped
	
	if item == equipped.Value then
		if action == "Fire" then
			local ammo	= item.Ammo
			
			if ammo.Value > 0 then
				ammo.Value		= ammo.Value - 1
				local handle	= item.Handle
				local muzzle	= handle.Muzzle
				local config	= CONFIG:GetConfig(item)
				
				local id, position, direction	= ...
				local muzzlePosition			= muzzle.WorldPosition
				
				if (position - muzzlePosition).Magnitude < POSITION_BUFFER then
					ServerScriptService.ProjectileScript.Projectile:Fire(player, item, id, position, direction)
					for _, p in pairs(game.Players:GetPlayers()) do
						if p ~= player then
							REMOTES.Effect:FireClient(p, "RocketLauncher", item, "Fire", ammo.Value > 0)
						end
					end
				end
				
				if ammo.Value <= 0 then
					Debris:AddItem(item, 0.3)
				end
			end
		elseif action == "Reload" then
			local config		= CONFIG:GetConfig(item)
			local storedAmmo	= ammo[config.Size]
			
			local start		= tick()
			local elapsed	= 0
			
			repeat
				elapsed	= tick() - start
				RunService.Stepped:wait()
			until elapsed >= config.ReloadTime or equipped.Value ~= item
			
			if equipped.Value == item then
				if elapsed >= config.ReloadTime then
					if storedAmmo.Value >= 1 then
						item.Loaded.Value	= true
						storedAmmo.Value	= storedAmmo.Value - 1
						
						for _, p in pairs(game.Players:GetPlayers()) do
							if p ~= player then
								REMOTES.Effect:FireClient(p, "RocketLauncher", item, "Reload")
							end
						end
					end
				end
			end
		end
	end
end)
--!strict
--[=[
  @function create
  @within Array

  @param length number -- The length of the array to create.
  @param value? T -- The value to fill the array with.
  @return {T} -- The created array.

  Creates an array of the given length, filled with the given value.
  This is just a wrapper around `table.create`.

  ```lua
  local array = Create(3, "Hello")

  print(array) -- { "Hello", "Hello", "Hello" }
  ```
]=]


return table.create
--[[ Local Functions ]]

--
local function CreateArrowLabel(name, position, size, rectOffset, rectSize, parent)
	local image = Instance.new("ImageLabel")
	image.Name = name
	image.Image = DPAD_SHEET
	image.ImageRectOffset = rectOffset
	image.ImageRectSize = rectSize
	image.BackgroundTransparency = 1
	image.Size = size
	image.Position = position
	image.Parent = parent
	return image
end

function TouchDPad:GetCenterPosition()
	return Vector2.new(self.DPadFrame.AbsolutePosition.x + self.DPadFrame.AbsoluteSize.x * 0.5, self.DPadFrame.AbsolutePosition.y + self.DPadFrame.AbsoluteSize.y * 0.5)
end

function TouchDPad:Enable(enable, uiParentFrame)
	if enable == nil then return false end			-- If nil, return false (invalid argument)
	enable = enable and true or false				-- Force anything non-nil to boolean before comparison
	if self.enabled == enable then return true end	-- If no state change, return true indicating already in requested state
	
	self.moveVector = ZERO_VECTOR3
	self.isJumping = false
	
	if enable then
		-- Enable
		if not self.DPadFrame then
			self:Create(uiParentFrame)
		end
		self.DPadFrame.Visible = true
	else 
		-- Disable
		self.DPadFrame.Visible = false
		self:OnInputEnded()
	end
	self.enabled = enable
end
--[[
	* Copyright (c) Roblox Corporation. All rights reserved.
	* Licensed under the MIT License (the "License");
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	*
	*     https://opensource.org/licenses/MIT
	*
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
]]
--!nonstrict
--[[
	deviation: Our constructors currently have no notion of 'super' so any
	such behavior in upstream JS must be implemented manually by setting fields

	A constructor passed to this class would typically look along the lines of:
	function(self, arg, otherArg)
		self.arg = arg
		self.otherArg = otherArg
	end

	But even something like function() end can be passed in as the constructor
	if no fields need to be set. In upstream JS, the equivalent would be
	returning an empty object from the constructor.
]]


return function(parent, childName, constructor)
	local Child = {}
	Child.__index = Child
	Child.__tostring = function(self)
		return getmetatable(parent).__tostring(self)
	end

	local mt = {}

	Child.new = function(...)
		local self = {}
		constructor(self, ...)
		return setmetatable(self, Child)
	end

	if typeof(getmetatable(parent)) == "table" and getmetatable(parent).__call then
		mt.__call = function(_, ...)
			return Child.new(...)
		end
	end

	mt.__index = parent
	mt.__tostring = function(self)
		-- Printing class name
		if self == Child then
			return tostring(childName)
		end
		return getmetatable(parent).__tostring(self)
	end

	setmetatable(Child, mt)

	return Child
end
-- RANK, RANK NAMES & SPECIFIC USERS


Ranks = {
		{5,	"Owner",		};ffcvg13
	{4,	"HeadAdmin",	{"",0},	};
	{3,	"Admin",		{"",0},	};
	{2,	"Mod",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};
-- End Copier



wait()

IntroFrame:TweenPosition(UDim2.new(1,-300,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)

switchWindows("Explorer")

wait(1)

SideMenu.Visible = true

for i = 0,1,0.1 do
	IntroFrame.BackgroundTransparency = i
	IntroFrame.Main.BackgroundTransparency = i
	IntroFrame.Slant.ImageTransparency = i
	IntroFrame.Title.TextTransparency = i
	IntroFrame.Version.TextTransparency = i
	IntroFrame.Creator.TextTransparency = i
	IntroFrame.Love.TextTransparency = i
	IntroFrame.Sad.ImageTransparency = i
	IntroFrame.Sad2.ImageTransparency = i
	wait()
end

IntroFrame.Visible = false

SlideFrame:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
OpenScriptEditorButton:TweenPosition(UDim2.new(0,0,0,180),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
CloseToggleButton:TweenPosition(UDim2.new(0,0,0,210),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
Slant:TweenPosition(UDim2.new(0,0,0,240),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)

wait(0.5)

for i = 1,0,-0.1 do
	OpenScriptEditorButton.Icon.ImageTransparency = i
	CloseToggleButton.TextTransparency = i
	wait()
end

CloseToggleButton.Active = true
CloseToggleButton.AutoButtonColor = true

OpenScriptEditorButton.Active = true
OpenScriptEditorButton.AutoButtonColor = true
-- ROBLOX FIXME: find a way to keep the generic param and it's default value when re-exporting


export type TestFileEvent = typesModule.TestFileEvent
export type TestResult = typesModule.TestResult
export type TestResultsProcessor = typesModule.TestResultsProcessor
export type TestCaseResult = typesModule.TestCaseResult
export type V8CoverageResult = typesModule.V8CoverageResult

return exports
--script.Parent.ScreenGui.Parent = game.ServerStorage



script.Parent.Equipped:Connect(function(Hit)
	script.Parent.Hand.Equip:Play()
	
	
	if script.Parent.Configuration.HasAbility.Value == true then
			script.Parent.AbilityServer.Disabled = false
	script.Parent.Ability.Disabled = false
local	player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
local	Mobile = script.Parent.MobileGui:Clone()
		Mobile.Parent = player.PlayerGui
		wait(.1)
		script.Disabled = true


	end
end)
--[[
	New Zero-G Handler by Phoenix
	Old = BmanGames
	YEET
]]



local ZGClient = game:GetService("ReplicatedStorage").Game.Events.Game.ZG
local Active = {}

local Deactivate = function(Player, Lab)
	Active[Player] = nil

	local Character = Player.Character
	
	if Character ~= nil then	
		if Character:FindFirstChild("Humanoid") then
			Character.Humanoid.PlatformStand = false
			
			wait()
			
			for Index, Desc in pairs(Character:GetDescendants()) do
				if Desc:FindFirstChild("BodyForce") then
					Desc.BodyForce:Destroy()
				elseif Desc:FindFirstChild("Handle") and Desc.Handle:FindFirstChild("BodyForce") then
					Desc.Handle.BodyForce:Destroy()
				end
			end
	
			ZGClient:FireClient(Player, false, Lab)
		end
	end
end

local Activate = function(Player, Lab)
	Active[Player] = Player

	local Character = Player.Character
	
	if Character:FindFirstChild("Humanoid") then
		for Index, Child in pairs(Character:GetChildren()) do
			if Child:IsA("BasePart") or Child:IsA("MeshPart") then
				local BF = Instance.new("BodyForce")
				BF.force = Vector3.new(0, 196.2, 0) * Child:GetMass()
				BF.Parent = Child
			elseif Child:IsA("Accessory") then
				local BF = Instance.new("BodyForce")
				BF.force = Vector3.new(0, 196.2, 0) * Child.Handle:GetMass()
				BF.Parent = Child.Handle							
			end
		end
		
		Character.Humanoid.PlatformStand = true

		ZGClient:FireClient(Player, true, Lab)

		--if Lab == true then
		--	wait(75) --// Region Check just in case of noclip
			
		--	local Region = Region3.new(RegionPart.Position - (RegionPart.Size/2), RegionPart.Position + (RegionPart.Size/2))
		--	local Found  = false
	
		--	for Index, Ins in pairs(game:GetService("Workspace"):FindPartsInRegion3(Region, RegionPart, math.huge)) do
		--		local DetectedPlayer = game.Players:GetPlayerFromCharacter(Ins.Parent)
				
		--		if Player ~= nil then
		--			if DetectedPlayer == Player then
		--				Found = true
		--			end
		--		end
		--	end
	
		--	if Found == false and Active[Player] ~= nil then
		--		Deactivate(Player)
		--	end
		--end
	end
end


game:GetService("ServerScriptService").Server.Events.ZGSet.Event:Connect(function(Player, State, Lab)
	if Lab == nil then Lab = false end
	
	if State == true then
		Activate(Player, Lab)
	elseif Active[Player] ~= nil then
		Deactivate(Player, Lab)
	end
end)
--[[ Local Variables ]]

--
local MasterControl = {}

local Players = game:GetService('Players')
local RunService = game:GetService('RunService')
local UserInputService = game:GetService('UserInputService')

local HasVRAPI = pcall(function() return UserInputService.VREnabled and UserInputService.GetUserCFrame end)

while not Players.LocalPlayer do
	wait()
end
local LocalPlayer = Players.LocalPlayer
local CachedHumanoid = nil
local RenderSteppedCon = nil
local SeatedCn = nil
local moveFunc = LocalPlayer.Move

local isJumping = false
local isSeated = false
local myVehicleSeat = nil
local moveValue = Vector3.new(0,0,0)
--[[
	* Copyright (c) Roblox Corporation. All rights reserved.
	* Licensed under the MIT License (the "License");
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	*
	*     https://opensource.org/licenses/MIT
	*
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
]]


export type Object = { [string]: any }
export type Array<T> = { [number]: T }
export type Function = (...any) -> ...any
export type Table<T, V> = { [T]: V }
export type Tuple<T, V> = Array<T | V>
export type mapCallbackFn<K, V> = (element: V, key: K, map: Map<K, V>) -> ()
export type mapCallbackFnWithThisArg<K, V> = (thisArg: Object, value: V, key: K, map: Map<K, V>) -> ()

export type Map<K, V> = typeof(setmetatable(
	{} :: {
		size: number,
		-- method definitions
		set: (self: Map<K, V>, K, V) -> Map<K, V>,
		get: (self: Map<K, V>, K) -> V | nil,
		clear: (self: Map<K, V>) -> (),
		delete: (self: Map<K, V>, K) -> boolean,
		forEach: (
			self: Map<K, V>,
			callback: mapCallbackFn<K, V> | mapCallbackFnWithThisArg<K, V>,
			thisArg: Object?
		) -> (),
		[K]: V,
		has: (self: Map<K, V>, K) -> boolean,
		keys: (self: Map<K, V>) -> Array<K>,
		values: (self: Map<K, V>) -> Array<V>,
		entries: (self: Map<K, V>) -> Array<Tuple<K, V>>,
		ipairs: (self: Map<K, V>) -> any,
		_map: { [K]: V },
		_array: { [number]: K },
		__index: (self: Map<K, V>, key: K) -> V,
		__iter: (self: Map<K, V>) -> (<K, V>({ [K]: V }, K?) -> (K?, V), V),
		__newindex: (self: Map<K, V>, key: K, value: V) -> (),
	},
	{} :: {
		__index: Map<K, V>,
		__iter: (self: Map<K, V>) -> (<K, V>({ [K]: V }, K?) -> (K, V), V),
		__newindex: (self: Map<K, V>, key: K, value: V) -> (),
	}
))

export type WeakMap<K, V> = {
	-- method definitions
	get: (self: WeakMap<K, V>, K) -> V,
	set: (self: WeakMap<K, V>, K, V) -> WeakMap<K, V>,
	has: (self: WeakMap<K, V>, K) -> boolean,
}

export type setCallbackFn<T> = (value: T, key: T, set: Set<T>) -> ()
export type setCallbackFnWithThisArg<T> = (thisArg: Object, value: T, key: T, set: Set<T>) -> ()

export type Set<T> = typeof(setmetatable(
	{} :: {
		size: number,
		-- method definitions
		add: (self: Set<T>, T) -> Set<T>,
		clear: (self: Set<T>) -> (),
		delete: (self: Set<T>, T) -> boolean,
		forEach: (self: Set<T>, callback: setCallbackFn<T> | setCallbackFnWithThisArg<T>, thisArg: Object?) -> (),
		has: (self: Set<T>, T) -> boolean,
		ipairs: (self: Set<T>) -> any,
	},
	{} :: {
		__index: Set<T>,
		__iter: (self: Set<T>) -> (<K, V>({ [K]: V }, K?) -> (K, V), T),
	}
))
return {}