repo
stringclasses
350 values
file_path
stringlengths
29
200
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.01M
tokens
int64
2
598k
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/Spring.luau
luau
.luau
--!nonstrict --[[ Constructs a new computed state object, which follows the value of another state object using a spring simulation. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Types = require(Package.Types) local logError = require(Package.Logging.logError) local logErr...
1,550
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/Tween.luau
luau
.luau
--!nonstrict --[[ Constructs a new computed state object, which follows the value of another state object using a tween. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Types = require(Package.Types) local TweenScheduler = require(Package.Animation.TweenScheduler) local useD...
961
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/TweenScheduler.luau
luau
.luau
--!strict --[[ Manages batch updating of tween objects. ]] local RunService = game:GetService("RunService") local Package = script.Parent.Parent local Types = require(Package.Types) local lerpType = require(Package.Animation.lerpType) local getTweenRatio = require(Package.Animation.getTweenRatio) local updateAll = ...
464
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/getTweenRatio.luau
luau
.luau
--!strict --[[ Given a `tweenInfo` and `currentTime`, returns a ratio which can be used to tween between two values over time. ]] local TweenService = game:GetService("TweenService") local function getTweenRatio(tweenInfo: TweenInfo, currentTime: number): number local delay = tweenInfo.DelayTime local duration =...
247
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/lerpType.luau
luau
.luau
--!strict --[[ Linearly interpolates the given animatable types by a ratio. If the types are different or not animatable, then the first value will be returned for ratios below 0.5, and the second value for 0.5 and above. FIXME: This function uses a lot of redefinitions to suppress false positives from the Luau ...
1,518
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/packType.luau
luau
.luau
--!strict --[[ Packs an array of numbers into a given animatable data type. If the type is not animatable, nil will be returned. FUTURE: When Luau supports singleton types, those could be used in conjunction with intersection types to make this function fully statically type checkable. ]] local Package = script...
813
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/springCoefficients.luau
luau
.luau
--!strict --[[ Returns a 2x2 matrix of coefficients for a given time, damping and speed. Specifically, this returns four coefficients - posPos, posVel, velPos, and velVel - which can be multiplied with position and velocity like so: local newPosition = oldPosition * posPos + oldVelocity * posVel local newVelocit...
1,003
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Animation/unpackType.luau
luau
.luau
--!strict --[[ Unpacks an animatable type into an array of numbers. If the type is not animatable, an empty array will be returned. FIXME: This function uses a lot of redefinitions to suppress false positives from the Luau typechecker - ideally these wouldn't be required FUTURE: When Luau supports singleton typ...
731
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Dependencies/captureDependencies.luau
luau
.luau
--!strict --[[ Calls the given callback, and stores any used external dependencies. Arguments can be passed in after the callback. If the callback completed successfully, returns true and the returned value, otherwise returns false and the error thrown. The callback shouldn't yield or run asynchronously. NOTE: ...
361
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Dependencies/initDependency.luau
luau
.luau
--!strict --[[ Registers the creation of an object which can be used as a dependency. This is used to make sure objects don't capture dependencies originating from inside of themselves. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local sharedState = require(Package.Dependenc...
146
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Dependencies/sharedState.luau
luau
.luau
--!strict --[[ Stores shared state for dependency management functions. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) type Set<T> = {[T]: any} -- The set where used dependencies should be saved to. local dependencySet: Set<PubTypes.Dependency>? = nil -- A stack of sets where n...
125
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Dependencies/updateAll.luau
luau
.luau
--!strict --[[ Given a reactive object, updates all dependent reactive objects. Objects are only ever updated after all of their dependencies are updated, are only ever updated once, and won't be updated if their dependencies are unchanged. ]] local Package = script.Parent.Parent local PubTypes = require(Package....
449
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Dependencies/useDependency.luau
luau
.luau
--!strict --[[ If a target set was specified by captureDependencies(), this will add the given dependency to the target set. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local sharedState = require(Package.Dependencies.sharedState) local initialisedStack = sharedState.initiali...
168
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/Children.luau
luau
.luau
--!strict --[[ A special key for property tables, which parents any given descendants into an instance. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local logWarn = require(Package.Logging.logWarn) local Observer = require(Package.State.Observer) local xtypeof = require(Package...
1,010
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/Cleanup.luau
luau
.luau
--!strict --[[ A special key for property tables, which adds user-specified tasks to be run when the instance is destroyed. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Cleanup = {} Cleanup.type = "SpecialKey" Cleanup.kind = "Cleanup" Cleanup.stage = "observer" function...
106
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/Hydrate.luau
luau
.luau
--!strict --[[ Processes and returns an existing instance, with options for setting properties, event handlers and other attributes on the instance. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local applyInstanceProps = require(Package.Instances.applyInstanceProps) local func...
104
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/New.luau
luau
.luau
--!strict --[[ Constructs and returns a new instance, with options for setting properties, event handlers and other attributes on the instance right away. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local defaultProps = require(Package.Instances.defaultProps) local applyInstan...
203
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/OnChange.luau
luau
.luau
--!strict --[[ Constructs special keys for property tables which connect property change listeners to an instance. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local logError = require(Package.Logging.logError) local function OnChange(propertyName: string): PubTypes.SpecialKey...
225
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/OnEvent.luau
luau
.luau
--!strict --[[ Constructs special keys for property tables which connect event listeners to an instance. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local logError = require(Package.Logging.logError) local function getProperty_unsafe(instance: Instance, property: string) ret...
242
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/Out.luau
luau
.luau
--!strict --[[ A special key for property tables, which allows users to extract values from an instance into an automatically-updated Value object. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local logError = require(Package.Logging.logError) local xtypeof = require(Package.Ut...
286
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/Ref.luau
luau
.luau
--!strict --[[ A special key for property tables, which stores a reference to the instance in a user-provided Value object. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local logError = require(Package.Logging.logError) local xtypeof = require(Package.Utility.xtypeof) local Re...
177
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/applyInstanceProps.luau
luau
.luau
--!strict --[[ Applies a table of properties to an instance, including binding to any given state objects and applying any special keys. No strong reference is kept by default - special keys should take care not to accidentally hold strong references to instances forever. If a key is used twice, an error will b...
993
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Instances/defaultProps.luau
luau
.luau
--!strict --[[ Stores 'sensible default' properties to be applied to instances created by the New function. ]] return { ScreenGui = { ResetOnSpawn = false, ZIndexBehavior = Enum.ZIndexBehavior.Sibling }, BillboardGui = { ResetOnSpawn = false, ZIndexBehavior = Enum.ZIndexBehavior.Sibling }, SurfaceGui...
790
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Logging/logError.luau
luau
.luau
--!strict --[[ Utility function to log a Fusion-specific error. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local messages = require(Package.Logging.messages) local function logError(messageID: string, errObj: Types.Error?, ...) local formatString: string if messages[messageID] ~...
221
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Logging/logErrorNonFatal.luau
luau
.luau
--!strict --[[ Utility function to log a Fusion-specific error, without halting execution. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local messages = require(Package.Logging.messages) local function logErrorNonFatal(messageID: string, errObj: Types.Error?, ...) local formatString...
238
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Logging/logWarn.luau
luau
.luau
--!strict --[[ Utility function to log a Fusion-specific warning. ]] local Package = script.Parent.Parent local messages = require(Package.Logging.messages) local function logWarn(messageID, ...) local formatString: string if messages[messageID] ~= nil then formatString = messages[messageID] else messageID ...
118
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Logging/parseError.luau
luau
.luau
--!strict --[[ An xpcall() error handler to collect and parse useful information about errors, such as clean messages and stack traces. TODO: this should have a 'type' field for runtime type checking! ]] local Package = script.Parent.Parent local Types = require(Package.Types) local function parseError(err: stri...
122
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/PubTypes.luau
luau
.luau
--!strict --[[ Stores common public-facing type information for Fusion APIs. ]] type Set<T> = {[T]: any} --[[ General use types ]] -- A unique symbolic value. export type Symbol = { type: string, -- replace with "Symbol" when Luau supports singleton types name: string } -- Types that can be expressed as vector...
1,063
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/Computed.luau
luau
.luau
--!nonstrict --[[ Constructs and returns objects which can be used to model derived reactive state. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local captureDependencies = require(Package.Dependencies.captureDependencies) local initDependency = require(Package.Dependencies.initDepen...
822
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/ForKeys.luau
luau
.luau
--!nonstrict --[[ Constructs a new ForKeys state object which maps keys of an array using a `processor` function. Optionally, a `destructor` function can be specified for cleaning up calculated keys. If omitted, the default cleanup function will be used instead. Optionally, a `meta` value can be returned in the...
1,962
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/ForPairs.luau
luau
.luau
--!nonstrict --[[ Constructs a new ForPairs object which maps pairs of a table using a `processor` function. Optionally, a `destructor` function can be specified for cleaning up values. If omitted, the default cleanup function will be used instead. Additionally, a `meta` table/value can optionally be returned t...
2,400
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/Observer.luau
luau
.luau
--!nonstrict --[[ Constructs a new state object which can listen for updates on another state object. FIXME: enabling strict types here causes free types to leak ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Types = require(Package.Types) local initDependency = require(P...
496
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/Value.luau
luau
.luau
--!nonstrict --[[ Constructs and returns objects which can be used to model independent reactive state. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local useDependency = require(Package.Dependencies.useDependency) local initDependency = require(Package.Dependencies.initDependency) l...
390
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/State/unwrap.luau
luau
.luau
--!strict --[[ A common interface for accessing the values of state objects or constants. ]] local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local xtypeof = require(Package.Utility.xtypeof) local function unwrap<T>(item: PubTypes.CanBeState<T>, useDependency: boolean?): T return if ...
104
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Types.luau
luau
.luau
--!strict --[[ Stores common type information used internally. These types may be used internally so Fusion code can type-check, but should never be exposed to public users, as these definitions are fair game for breaking changes. ]] local Package = script.Parent local PubTypes = require(Package.PubTypes) type ...
1,104
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/None.luau
luau
.luau
--!strict --[[ A symbol for representing nil values in contexts where nil is not usable. ]] local Package = script.Parent.Parent local Types = require(Package.Types) return { type = "Symbol", name = "None" } :: Types.None
52
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/cleanup.luau
luau
.luau
--!strict --[[ Cleans up the tasks passed in as the arguments. A task can be any of the following: - an Instance - will be destroyed - an RBXScriptConnection - will be disconnected - a function - will be run - a table with a `Destroy` or `destroy` function - will be called - an array - `cleanup` will be called...
324
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/doNothing.luau
luau
.luau
--!strict --[[ An empty function. Often used as a destructor to indicate no destruction. ]] local function doNothing(...: any) end return doNothing
35
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/isSimilar.luau
luau
.luau
--!strict --[[ Returns true if A and B are 'similar' - i.e. any user of A would not need to recompute if it changed to B. ]] local function isSimilar(a: any, b: any): boolean -- HACK: because tables are mutable data structures, don't make assumptions -- about similarity from equality for now (see issue...
116
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/needsDestruction.luau
luau
.luau
--!strict --[[ Returns true if the given value is not automatically memory managed, and requires manual cleanup. ]] local function needsDestruction(x: any): boolean return typeof(x) == "Instance" end return needsDestruction
53
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/restrictRead.luau
luau
.luau
--!strict --[[ Restricts the reading of missing members for a table. ]] local Package = script.Parent.Parent local logError = require(Package.Logging.logError) type table = {[any]: any} local function restrictRead(tableName: string, strictTable: table): table -- FIXME: Typed Luau doesn't recognise this correctly ...
145
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/Utility/xtypeof.luau
luau
.luau
--!strict --[[ Extended typeof, designed for identifying custom objects. If given a table with a `type` string, returns that. Otherwise, returns `typeof()` the argument. ]] local function xtypeof(x: any) local typeString = typeof(x) if typeString == "table" and typeof(x.type) == "string" then return x.type e...
93
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/Fusion/init.luau
luau
.luau
--!strict --[[ The entry point for the Fusion library. ]] local PubTypes = require(script.PubTypes) local restrictRead = require(script.Utility.restrictRead) export type StateObject<T> = PubTypes.StateObject<T> export type CanBeState<T> = PubTypes.CanBeState<T> export type Symbol = PubTypes.Symbol export type Value...
780
Redon-Tech/radio-system
Redon-Tech-radio-system-b267e79/src/system/shared/util.luau
luau
.luau
local TextService = game:GetService("TextService") local util = {} -- Below function is basically copy and pasted from Roblox core scripts for the chat function util.getStringTextBounds(text, font, textSize, sizeBounds) sizeBounds = sizeBounds or Vector2.new(10000, 10000) return TextService:GetTextSize(text, textSiz...
182
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/.lune/build.luau
luau
.luau
local process = require("@lune/process") local INIT_PATH = "src/init.luau" local BUNDLE_PATH = "bin/PNGuin.luau" local RBXM_PATH = "bin/PNGuin.rbxm" local function buildPesde() local result = process.exec("darklua", {"process", INIT_PATH, BUNDLE_PATH}) assert(result.ok, result.stderr) end local function buildRBXM...
145
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/.lune/bump.luau
luau
.luau
local process = require("@lune/process") local fs = require("@lune/fs") local serde = require("@lune/serde") local PESDE_CONFIG_PATH = "pesde.toml" local function writeVersion(version: string) local data = fs.readFile(PESDE_CONFIG_PATH) local config: {version: string} = serde.decode("toml", data) config.version = ...
150
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Decoding/HuffmanTree.luau
luau
.luau
--!strict --!native --!optimize 2 local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream type HuffmanNode = { [number]: HuffmanNode } & {sym: number?} export type HuffmanTree = { root: HuffmanNode, Read: (self: HuffmanTree, stream: BitStream) -> number } local function Read(self...
606
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Decoding/Parser.luau
luau
.luau
--!strict --!native --!optimize 2 local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream export type Parser = { _output: buffer, _outputPos: number, _outputChunks: {buffer}, window: buffer, windowPos: number, windowSize: number, stream: BitStream, ToOutput: (self: Parser, v...
1,050
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Decoding/Zlib.luau
luau
.luau
--!strict --!native --!optimize 2 local HuffmanTree = require("../Decoding/HuffmanTree") local Parser = require("../Decoding/Parser") local BitStream = require("../Parsing/BitStream") type BitStream = BitStream.BitStream type HuffmanTree = HuffmanTree.HuffmanTree type Parser = Parser.Parser local lenBase = { 3, 4,...
1,735
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Parsing/BitStream.luau
luau
.luau
--!strict --!native --!optimize 2 export type BitStream = { data: buffer, len: number, pos: number, offset: number, Bits: (self: BitStream, width: number) -> number, UInt: (self: BitStream, width: number) -> number, String: (self: BitStream, length: number) -> string, Align: (self: BitStream) -> () } local r...
430
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Parsing/ByteStream.luau
luau
.luau
--!strict --!native --!optimize 2 export type ByteStream = { data: buffer, len: number, pos: number, UInt: (self: ByteStream, width: number, big: boolean?) -> number, String: (self: ByteStream, length: number) -> string, } local readMap = { [1] = buffer.readu8, [2] = buffer.readu16, [4] = buffer.readu32 } ...
262
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Parsing/ChunkStream.luau
luau
.luau
--!strict --!native --!optimize 2 local Types = require("../Types") local ByteStream = require("../Parsing/ByteStream") type PNGInfo = Types.PNGInfo type ColorType = Types.ColorType type ByteStream = ByteStream.ByteStream export type ChunkStream = { info: PNGInfo, stream: ByteStream, Read: (self: ChunkStream, ch...
993
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/Types.luau
luau
.luau
--!strict --!optimize 2 export type PNGInfo = { IDAT: buffer, PLTE: buffer, tRNS: buffer?, width: number, height: number, bitDepth: number, colorType: ColorType, hasAlpha: boolean, channels: number, --[=[ Decodes IDAT chunks into (RGBA) pixel data @within PNGInfo @return buffer -- Pixel data @re...
147
wizevaxel/pnguin
wizevaxel-pnguin-065efbd/src/init.luau
luau
.luau
--!strict --!native --!optimize 2 local Types = require("@self/Types") local ChunkStream = require("@self/Parsing/ChunkStream") local ByteStream = require("@self/Parsing/ByteStream") local Zlib = require("@self/Decoding/Zlib") local Filter = require("@self/Decoding/Filter") type PNGInfo = Types.PNGInfo local PNGuin ...
490
dig1t/red
dig1t-red-06ba334/examples/rojo/Client/_init.client.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local red = require(ReplicatedStorage.Packages.red) red.subscribe(function(action: red.Action<any>) if action.type == "PLAYER_KILL" then print(`{action.payload} was killed!`) end end) -- "get" will wait for a result local data = red.get({ type = "GET...
100
dig1t/red
dig1t-red-06ba334/examples/rojo/Server/Controllers/PlayerController.luau
luau
.luau
local PlayerController = {} function PlayerController.kill(player: Player): boolean? local character = player.Character :: Model? local humanoid = character and character:FindFirstChildOfClass("Humanoid") :: Humanoid? if humanoid then humanoid.Health = 0 print(player.Name .. " was killed!") return true ...
150
dig1t/red
dig1t-red-06ba334/examples/rojo/Server/Handlers/Loader.luau
luau
.luau
local red = require(game.ReplicatedStorage.Packages.red) return function(bind: red.Bind) bind("GET_DATA", function(_player: Player) print("Getting data...") task.wait(1) return { type = "DATA", payload = { data = "Hello, world!" }, } end) end
72
dig1t/red
dig1t-red-06ba334/examples/rojo/Server/Handlers/PingPong.luau
luau
.luau
local red = require(game.ReplicatedStorage.Packages.red) return function(bind: red.Bind) bind("PING", function(player: Player) red.dispatch(player, { type = "PONG" }) end) end
48
dig1t/red
dig1t-red-06ba334/examples/rojo/Server/Handlers/Player.luau
luau
.luau
local red = require(game.ReplicatedStorage.Packages.red) local PlayerController = require(script.Parent.Parent.Controllers.PlayerController) return function(bind: red.Bind) bind("PLAYER_KILL", function(player: Player) local success = PlayerController.kill(player) if success then red.dispatch(true, { type = "...
124
dig1t/red
dig1t-red-06ba334/examples/rojo/Server/_init.server.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local red = require(ReplicatedStorage.Packages.red) local Loader = require(script.Parent.Handlers.Loader) local PingPong = require(script.Parent.Handlers.PingPong) red.useHandlers({ Loader, PingPong, }) -- Alternatively you can use red.useHandlers(scr...
88
dig1t/red
dig1t-red-06ba334/examples/server-bind/init._server.luau
luau
.luau
--!nocheck local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Util = require(ReplicatedStorage.Packages.Util) local red = require(ReplicatedStorage.Packages.red) red.bind("PLAYER_TELEPORT", function(player, payload) if Util.isAlive(player) then task.wai...
241
dig1t/red
dig1t-red-06ba334/src/Constants.luau
luau
.luau
return { REMOTE_FOLDER_NAME = "redRemotes", STORE_TIMEOUT = 6, -- seconds to wait before rejecting a get() promise }
31
dig1t/red
dig1t-red-06ba334/src/Types.luau
luau
.luau
--!strict export type BindCallback = (Player, ActionPayload<any>) -> () export type Bind = (string, BindCallback) -> () export type ActionPayload<T> = T export type Action<T> = { uid: string?, method: string?, player: Player?, timeout: number?, type: string, payload: ActionPayload<T>, success: boolean?, err:...
104
dig1t/red
dig1t-red-06ba334/src/init.luau
luau
.luau
--!strict local Store = require(script.Store) local Types = require(script.Types) export type ActionPayload<T> = Types.ActionPayload<T> export type Action<T> = Types.Action<T> export type BindCallback = Types.BindCallback export type Bind = Types.Bind export type Handler = Types.Handler return Store
66
dig1t/red
dig1t-red-06ba334/src/redUtil.luau
luau
.luau
--!strict local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local Constants = require(script.Parent.Constants) local Util = {} function Util.getRemotes(): { Client: RemoteEvent, UnreliableClient: UnreliableRemoteEvent } local remotes = RunService:IsClie...
296
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/autoUpdate.luau
luau
.luau
local types = require(script.Parent.types) local platform = require(script.Parent.platform) local unwrapElement = platform.unwrapElement --[[ Automatically updates the position of the floating element when necessary. Should only be called when the floating element is mounted or visible on the screen. ]] local funct...
175
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/computePosition.luau
luau
.luau
local types = require(script.Parent.types) local placement = require(script.Parent.utils.placement) local getPlacementPosition = placement.getPlacementPosition local function computePosition(rects: types.ElementRects, placement: types.Placement, rtl: boolean) local reference = rects.reference local target = rects.t...
330
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/detectOverflow.luau
luau
.luau
local types = require(script.Parent.types) local getPaddingObject = require(script.Parent.utils.getPaddingObject) local rects = require(script.Parent.utils.rects) local convertRectToBoundingRect = rects.convertRectToBoundingRect local platform = require(script.Parent.platform) local getOffsetParent = platform.getOff...
744
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/init.luau
luau
.luau
local types = require(script.types) -- Positioning export type Placement = types.Placement export type Side = types.Side export type Alignment = types.Alignment export type Axis = types.Axis export type Length = types.Length export type Position = types.Position export type Dimensions = types.Dimensions -- Shapes exp...
737
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/middleware/init.luau
luau
.luau
local offset = require(script.offset) local shift = require(script.shift) local hide = require(script.hide) local size = require(script.size) local flip = require(script.flip) local autoPlacement = require(script.autoPlacement) local arrow = require(script.arrow) local inline = require(script.inline) export type Offse...
182
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/convertOffsetParentRectToRelativeRect.luau
luau
.luau
local types = require(script.Parent.Parent.types) local getLayerElement = require(script.Parent.getLayerElement) local getElementBoundingRect = require(script.Parent.getElementBoundingRect) local getScale = require(script.Parent.getScale) --[[ Converts the given rect into a rect that is relative to that of the given...
251
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getClippingRect.luau
luau
.luau
local types = require(script.Parent.Parent.types) local getLayerElement = require(script.Parent.getLayerElement) local isElement = require(script.Parent.isElement) local rects = require(script.Parent.Parent.utils.rects) local createRectFromGuiObject = rects.createRectFromGuiObject local convertRectToBoundingRect = re...
863
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getElementBoundingRect.luau
luau
.luau
local types = require(script.Parent.Parent.types) local getScale = require(script.Parent.getScale) local function createBoundingRectFromElement(element: types.ContainingElement): types.BoundingRect local position = element.AbsolutePosition local size = element.AbsoluteSize return { x = position.X, y = positio...
393
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getElementRects.luau
luau
.luau
local types = require(script.Parent.Parent.types) local getOffsetParent = require(script.Parent.getOffsetParent) local getRectRelativeToOffsetParent = require(script.Parent.getRectRelativeToOffsetParent) --[[ Returns the rects of the reference and target element. Two things to note: - The reference element is r...
211
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getLayerElement.luau
luau
.luau
local types = require(script.Parent.Parent.types) --[[ Returns the contaning `LayerCollector` instance of the given element, if one exists. ]] local function getLayerElement(element: types.ContainingElement): LayerCollector? return if element:IsA("LayerCollector") then element else element:FindFirstAncestorWhichIsA(...
77
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getOffsetParent.luau
luau
.luau
local isElement = require(script.Parent.isElement) --[[ Returns the "offset" parent of the given element. The "offset" parent is the first valid parent of the given element. Most of the time, this is just the `Parent` value, but there are cases where a `Folder` instance may be used. Because of that, this is usef...
141
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getRectRelativeToOffsetParent.luau
luau
.luau
local types = require(script.Parent.Parent.types) local getElementBoundingRect = require(script.Parent.getElementBoundingRect) local function getRectRelativeToOffsetParent( element: types.ReferenceElement, offsetParent: types.ContainingElement | nil, cache: types.Cache ): types.Rect local elementRect = getElement...
225
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/getScale.luau
luau
.luau
local types = require(script.Parent.Parent.types) local isElement = require(script.Parent.isElement) --[[ Returns the scale of the given element. The scale of an element is the factor of each ancestor `UIScale` that affects it. ]] local function getScale(element: types.ContainingElement, cache: types.Cache) loca...
164
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/init.luau
luau
.luau
return { getOffsetParent = require(script.getOffsetParent), getElementRects = require(script.getElementRects), getClippingRect = require(script.getClippingRect), getLayerElement = require(script.getLayerElement), getRectRelativeToOffsetParent = require(script.getRectRelativeToOffsetParent), getElementBoundingRect...
115
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/isElement.luau
luau
.luau
--[[ Returns `true` if the provided value is a `GuiObject` or a `LayerCollector`. ]] local function isElement(x: unknown) if typeof(x) ~= "Instance" then return false end return x:IsA("GuiObject") or x:IsA("LayerCollector") end return isElement
69
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/platform/unwrapElement.luau
luau
.luau
local types = require(script.Parent.Parent.types) --[[ Attempts to unwrap an element into its `GuiObject` form, if one exists. If the given element is virtual and has a `contextElement` value then that is what is returned. ]] local function unwrapElement(element: types.ReferenceElement) return if typeof(element) ...
84
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/process.luau
luau
.luau
local types = require(script.Parent.types) local computePosition = require(script.Parent.computePosition) local platform = require(script.Parent.platform) local getElementRects = platform.getElementRects local MAX_MIDDLEWARE_RESETS = 50 export type ProcessConfig = { --[[ Where to place the floating element...
770
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/types.luau
luau
.luau
-- Placement export type Side = "top" | "left" | "right" | "bottom" export type Placement = Side | "top-start" | "top-end" | "left-start" | "left-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" export type Alignment = "start" | "end" export type Axis = "x" | "y" export type Length = "width"...
734
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/utils/getPaddingObject.luau
luau
.luau
local types = require(script.Parent.Parent.types) local function getPaddingObject(padding: types.Padding): types.SideObject return if typeof(padding) == "number" then { top = padding, bottom = padding, left = padding, right = padding, } else { top = padding.top or 0, bottom = padding.bottom or...
109
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/utils/merge.luau
luau
.luau
local function merge<A, B>(a: A, b: B): A & B local cloned = table.clone(a :: any) for key, value in b :: any do cloned[key] = value end return (cloned :: any) :: A & B end return merge
65
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/utils/placement.luau
luau
.luau
local types = require(script.Parent.Parent.types) type Side = types.Side type Alignment = types.Alignment type Axis = types.Axis type Placement = types.Placement --[[ Returns the {@link Side | side} and {@link Alignment | alignment} of the given placement. Note that the alignment will only exist when the placement...
1,262
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/utils/read.luau
luau
.luau
local types = require(script.Parent.Parent.types) local function read<T>(value: types.DerivableInput<T>, state: types.MiddlewareState) return if typeof(value) == "function" then value(state) else value end return read
51
Quamatic/aether
Quamatic-aether-e98ae6f/src/core/src/utils/rects.luau
luau
.luau
local types = require(script.Parent.Parent.types) local function createRectFromGuiObject(element: GuiObject | LayerCollector) local position = element.AbsolutePosition local size = element.AbsoluteSize return { x = position.X, y = position.Y, width = size.X, height = size.Y, } end local function convertR...
224
Quamatic/aether
Quamatic-aether-e98ae6f/src/react/src/init.luau
luau
.luau
local Aether = require(script.Parent.Aether) -- Type re-exports export type Placement = Aether.Placement export type Side = Aether.Side export type Alignment = Aether.Alignment export type Axis = Aether.Axis export type Length = Aether.Length export type Position = Aether.Position export type Dimensions = Aether.Dimen...
782
Quamatic/aether
Quamatic-aether-e98ae6f/src/react/src/utils/shallowEqualDependencies.luau
luau
.luau
local middleware = require(script.Parent.Parent.middleware) type ReactiveMiddleware = middleware.ReactiveMiddleware local function shadowEqualDependencies(middlewareA: { ReactiveMiddleware }, middlewareB: { ReactiveMiddleware }) if middlewareA == middlewareB then return true end if #middlewareA ~= #middlewareB t...
241
Quamatic/aether
Quamatic-aether-e98ae6f/src/react/src/utils/useLatestRef.luau
luau
.luau
local React = require(script.Parent.Parent.Parent.React) local function useLatestRef<T>(value: T): { current: T } local ref = React.useRef(value) React.useLayoutEffect(function() ref.current = value end) return ref end return useLatestRef
59
Quamatic/aether
Quamatic-aether-e98ae6f/src/vide/src/init.luau
luau
.luau
local Aether = require(script.Parent.Aether) -- Type re-exports export type Placement = Aether.Placement export type Side = Aether.Side export type Alignment = Aether.Alignment export type Axis = Aether.Axis export type Length = Aether.Length export type Position = Aether.Position export type Dimensions = Aether.Dimen...
772
Quamatic/aether
Quamatic-aether-e98ae6f/stories/aether.storybook.luau
luau
.luau
return { name = "Aether", storyRoots = { script.Parent.vide, script.Parent.react }, groupRoots = true, }
30
Quamatic/aether
Quamatic-aether-e98ae6f/stories/react/Chrome.luau
luau
.luau
local React = require(script.Parent.Parent.Parent.DevPackages.React) local e = React.createElement type Props = { title: string, description: string, goal: string, children: any, } local function Chrome(props: Props) return e("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0....
1,031
Quamatic/aether
Quamatic-aether-e98ae6f/stories/react/Flip.story.luau
luau
.luau
local React = require(script.Parent.Parent.Parent.DevPackages.React) local ReactRoblox = require(script.Parent.Parent.Parent.DevPackages.ReactRoblox) local Aether = require(script.Parent.Parent.Parent.DevPackages.Aether) local AetherReact = require(script.Parent.Parent.Parent.DevPackages.AetherReact) local Chrome = re...
619
Quamatic/aether
Quamatic-aether-e98ae6f/stories/react/Placement.story.luau
luau
.luau
local React = require(script.Parent.Parent.Parent.DevPackages.React) local ReactRoblox = require(script.Parent.Parent.Parent.DevPackages.ReactRoblox) local Aether = require(script.Parent.Parent.Parent.DevPackages.Aether) local AetherReact = require(script.Parent.Parent.Parent.DevPackages.AetherReact) local Chrome = re...
1,386
Quamatic/aether
Quamatic-aether-e98ae6f/stories/vide/Arrow.story.luau
luau
.luau
local vide = require(script.Parent.Parent.Parent.DevPackages.Vide) local Aether = require(script.Parent.Parent.Parent.DevPackages.Aether) local AetherVide = require(script.Parent.Parent.Parent.DevPackages.AetherVide) local Chrome = require(script.Parent.Chrome) local create = vide.create local source = vide.source lo...
1,096
Quamatic/aether
Quamatic-aether-e98ae6f/stories/vide/AutoPlacement.story.luau
luau
.luau
local vide = require(script.Parent.Parent.Parent.DevPackages.Vide) local Aether = require(script.Parent.Parent.Parent.DevPackages.Aether) local AetherVide = require(script.Parent.Parent.Parent.DevPackages.AetherVide) local Chrome = require(script.Parent.Chrome) local create = vide.create local source = vide.source lo...
605
Quamatic/aether
Quamatic-aether-e98ae6f/stories/vide/Chrome.luau
luau
.luau
local vide = require(script.Parent.Parent.Parent.DevPackages.Vide) local create = vide.create export type Props = { title: string, description: string, goal: string, children: any, } local function Chrome(props: Props) return create "Frame" { Name = "Content", AnchorPoint = Vector2.new(0.5, 0.5), Position...
135
Quamatic/aether
Quamatic-aether-e98ae6f/stories/vide/Flip.story.luau
luau
.luau
local vide = require(script.Parent.Parent.Parent.DevPackages.Vide) local Aether = require(script.Parent.Parent.Parent.DevPackages.Aether) local AetherVide = require(script.Parent.Parent.Parent.DevPackages.AetherVide) local Chrome = require(script.Parent.Chrome) local create = vide.create local source = vide.source lo...
602