{"id":"howmanysmall/helium","name":"helium","scope":"howmanysmall","platform":"roblox","description":"Mirrored from the Wally registry.","version":"1.1.3","latest":"1.1.3","versions":["0.1.0","1.1.0","1.1.1","1.1.2","1.1.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"35d9b7cf1f4826dadd93289e1f2e1f7b68cdf26158d0a44f8e1daa3c790d120d","likes":0,"downloads":0,"install":"forest install howmanysmall/helium","url":"https://forest.dev/p/roblox/howmanysmall/helium","files":"https://api.forest.dev/ai/package/roblox/howmanysmall/helium/files","readme":"# Helium\r\n\r\nBased on the fantastic [Rocrastinate](https://github.com/headjoe3/Rocrastinate/).\r\n\r\n## Differences from Rocrastinate\r\n\r\n- Replaced Maid with [Janitor](https://github.com/howmanysmall/Janitor).\r\n- Removed the FastSpawn library with the task library.\r\n- PascalCase is superior to camelCase.\r\n- The Store is now using traditional OOP instead of a function that returns a table.\r\n- RedrawBindings are now Enums instead of just strings. This allows autofill if you're using the \"Luau-Powered Autocomplete & Language Features\" beta in Studio.\r\n- You can now redraw on Stepped.\r\n- The Store object now has two different names for dispatching and subscribing, being `Connect` and `Dispatch` for dispatching and `Connect` and `Subscribe` for subscribing.\r\n- Added the `MakeActionCreator` function to easily make functions.\r\n- Typed Luau support.\r\n- Added `Make` if you want to use that syntax for some reason.\r\n- Added a GlobalConfiguration which can be used to configure some internal behavior like typechecking.\r\n\r\n## Building\r\n\r\nIf you want to build the project and you have LuaJIT installed, you can use the following command in the root directory. Note that this still requires Rojo to build: `luajit Build.lua`\r\n\r\nIf you don't have LuaJIT installed, you can use the following command in the root directory. This again, still requires Rojo. `rojo build -o Helium.rbxm build.project.json`\r\n\r\n## Usage\r\n\r\n```Lua\r\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\r\nlocal TextService = game:GetService(\"TextService\")\r\n\r\nlocal Helium = require(ReplicatedStorage.Helium)\r\n\r\nlocal TextLabel = Helium.Component.Extend(\"TextLabel\")\r\n\r\nexport type Properties = {\r\n    Font: Enum.Font,\r\n    Text: string,\r\n    TextSize: number,\r\n}\r\n\r\nfunction TextLabel:Constructor(Parent: Instance, Properties: Properties)\r\n    self.Font = Properties.Font\r\n    self.Text = Properties.Text\r\n    self.TextSize = Properties.TextSize\r\n\r\n    self.Parent = Parent\r\n    self.ParentChanged = false\r\n\r\n    self.LabelSize = TextService:GetTextSize(self.Text, self.TextSize, self.Font, Vector2.new(math.huge, math.huge))\r\n\r\n    local TextLabel: TextLabel = self.Janitor:Add(Instance.new(\"TextLabel\"), \"Destroy\")\r\n    TextLabel.BackgroundTransparency = 1\r\n    TextLabel.TextSize = self.TextSize\r\n    TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)\r\n    TextLabel.Text = self.Text\r\n    TextLabel.Font = self.Font\r\n    TextLabel.Size = UDim2.fromOffset(self.LabelSize.X + 30, self.LabelSize.Y + 10)\r\n    TextLabel.Parent = Parent\r\n\r\n    self.Gui = TextLabel\r\nend\r\n\r\nfunction TextLabel:SetFont(Font: Enum.Font)\r\n    self.Font = Font\r\n    self.LabelSize = TextService:GetTextSize(self.Text, self.TextSize, self.Font, Vector2.new(math.huge, math.huge))\r\n    self.QueueRedraw()\r\n    return self\r\nend\r\n\r\nfunction TextLabel:SetText(Text: string)\r\n    self.Text = Text\r\n    self.LabelSize = TextService:GetTextSize(self.Text, self.TextSize, self.Font, Vector2.new(math.huge, math.huge))\r\n    self.QueueRedraw()\r\n    return self\r\nend\r\n\r\nfunction TextLabel:SetTextSize(TextSize: number)\r\n    self.TextSize = TextSize\r\n    self.LabelSize = TextService:GetTextSize(self.Text, self.TextSize, self.Font, Vector2.new(math.huge, math.huge))\r\n    self.QueueRedraw()\r\n    return self\r\nend\r\n\r\nfunction TextLabel:SetParent(Parent: Instance)\r\n    self.Parent = Parent\r\n    self.ParentChanged = true\r\n    self.QueueRedraw()\r\n    return self\r\nend\r\n\r\nTextLabel.RedrawBinding = Helium.RedrawBinding.Heartbeat\r\nfunction TextLabel:Redraw()\r\n    local TextLabel: TextLabel = self.Gui\r\n\r\n    TextLabel.TextSize = self.TextSize\r\n    TextLabel.Text = self.Text\r\n    TextLabel.Font = self.Font\r\n    TextLabel.Size = UDim2.fromOffset(self.LabelSize.X + 30, self.LabelSize.Y + 10)\r\n\r\n    if self.ParentChanged then\r\n        self.ParentChanged = false\r\n        TextLabel.Parent = self.Parent\r\n    end\r\nend\r\n\r\nreturn TextLabel\r\n```\r\n\r\n### Credits / External Dependencies\r\n\r\n- [Debug](https://github.com/RoStrap/Debugging/blob/master/Debug.lua) by Validark, which is used for the `Debug.DirectoryToString` and the `Debug.Assert` / `Debug.Error` / `Debug.Warn` functions.\r\n- [Enumerator](https://github.com/howmanysmall/enumerator) by HowManySmall, which is used for the `RedrawBinding`.\r\n- [Fmt](https://github.com/Nezuo/fmt) by Nezuo, which is used for printing out tables.\r\n- [Janitor](https://github.com/howmanysmall/Janitor) by Validark and HowManySmall, which is used for cleanup up in Helium.\r\n- [Rocrastinate](https://github.com/headjoe3/Rocrastinate) by Databrain, which was used as the basis of Helium.\r\n- [t](https://github.com/osyrisrblx/t) by Osyris, which is used for type checking internally.\r\n","readmeTruncated":false}