repo
stringclasses
254 values
file_path
stringlengths
29
241
code
stringlengths
100
233k
tokens
int64
14
69.4k
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/tween.luau
local bench = require("./bench") local ITERATIONS = 10000 do local tween = require("../packages/ripple/src/tween") local createTween = tween.createTween local scheduler = tween.scheduler bench("ripple", function() createTween(0, { start = true }):setGoal(1) for _ = 1, ITERATIONS do scheduler.step(1 / ITE...
199
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/vide/effect.luau
--[[ MIT License Copyright (c) 2022 centau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
339
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/vide/flags.luau
--[[ MIT License Copyright (c) 2022 centau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
287
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/vide/graph.luau
--[[ MIT License Copyright (c) 2022 centau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
2,173
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/vide/root.luau
--[[ MIT License Copyright (c) 2022 centau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
495
littensy/ripple
littensy-ripple-c33bb8b/benchmarks/vide/source.luau
--[[ MIT License Copyright (c) 2022 centau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
448
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/React.luau
type CoreReactBinding<T> = { getValue: (self: CoreReactBinding<T>) -> T, _source: string?, } type ReactBindingMap = { map: <T, U>(self: CoreReactBinding<T> & ReactBindingMap, (T) -> U) -> ReactBindingMap & CoreReactBinding<U>, } export type Binding<T> = CoreReactBinding<T> & ReactBindingMap return require(script....
104
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/Ripple.luau
local Ripple = require(script.Parent.Parent.ripple.src) export type Animatable = Ripple.Animatable export type Easing = Ripple.Easing export type Motion<T = any> = Ripple.Motion<T> export type MotionOptions<T = any> = Ripple.MotionOptions<T> export type Spring<T = any> = Ripple.Spring<T> export type SpringOptions<T = ...
113
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/helpers.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ReactGlobals = require(ReplicatedStorage["@rbxts-js"].ReactGlobals) ReactGlobals.__ROACT_17_MOCK_SCHEDULER__ = true local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox) local mountedContainers = {} local function render(element...
206
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/useMotion.test.luau
local React = require("../../React") local Ripple = require("../../Ripple") local helpers = require("./helpers") local test = require("../../../../tests/test") local useMotion = require("../useMotion") local render = helpers.render local cleanup = helpers.cleanup test.afterEach(function() cleanup() end) test("shoul...
172
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/useTween.test.luau
local React = require("../../React") local Ripple = require("../../Ripple") local helpers = require("./helpers") local test = require("../../../../tests/test") local useTween = require("../useTween") local render = helpers.render local cleanup = helpers.cleanup test.afterEach(function() cleanup() end) test("should ...
169
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/src/useMotion.luau
local React = require(script.Parent.Parent.React) local Ripple = require(script.Parent.Parent.Ripple) type Binding<T> = React.Binding<T> type Animatable = Ripple.Animatable type Motion<T> = Ripple.Motion<T> type MotionOptions<T> = Ripple.MotionOptions<T> local function useMotion<T>(initialValue: T, initialOptions: Mo...
218
littensy/ripple
littensy-ripple-c33bb8b/packages/react-ripple/src/useTween.luau
local React = require(script.Parent.Parent.React) local Ripple = require(script.Parent.Parent.Ripple) type Binding<T> = React.Binding<T> type Animatable = Ripple.Animatable type Tween<T> = Ripple.Tween<T> type TweenOptions<T> = Ripple.TweenOptions<T> local function useTween<T>(initialValue: T, initialOptions: TweenOp...
216
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/easing.test.luau
local easing = require("../easing") local test = require("../../../../tests/test") test("should have correct start and end", function() for name, easingFunction in pairs(easing) do local x0 = easingFunction(0) local x1 = easingFunction(1) assert(math.abs(x0) < 1e-4, `{name}(0) should be near 0, got {x0}`) ass...
237
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/init.luau
local test = require("../../../tests/test") test.describe("spring", function() require("@self/spring.test") end) test.describe("tween", function() require("@self/tween.test") end) test.describe("motion", function() require("@self/motion.test") end) test.describe("easing", function() require("@self/easing.test")...
126
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/motion.test.luau
local easing = require("../easing") local motion = require("../motion") local test = require("../../../../tests/test") local createMotion = motion.createMotion local scheduler = motion.scheduler test("should have expected api", function() local motion = createMotion(0) assert(type(motion.setPosition) == "function"...
4,046
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/tween.test.luau
local easing = require("../easing") local test = require("../../../../tests/test") local tween = require("../tween") local createTween = tween.createTween local scheduler = tween.scheduler test("should have expected api", function() local tween = createTween(0) assert(type(tween.setPosition) == "function", "missin...
2,171
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/utils/interpolate.test.luau
local interpolate = require("../../utils/interpolate") local test = require("../../../../../tests/test") local cases: { { any } } = { { 0, 1, 0.5 }, { vector.zero, vector.one, vector.create(0.5, 0.5, 0.5) }, { { 0, 0, 0 }, { 1, 1, 1 }, { 0.5, 0.5, 0.5 } }, } if game then table.insert(cases, { Color3.new(), Color3...
588
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/__tests__/utils/oklab.test.luau
local oklab = require("../../utils/oklab") local test = require("../../../../../tests/test") local function testColors(callback: (vector) -> ()) for r = 0, 4 do for g = 0, 4 do for b = 0, 4 do callback(vector.create(r, g, b) / 4) end end end end local function fuzzyEqual(a: vector, b: vector): boolean...
301
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/config.luau
local spring = require("./spring") type SpringOptions = spring.SpringOptions return { default = { tension = 170, friction = 26 } :: SpringOptions, gentle = { tension = 120, friction = 14 } :: SpringOptions, wobbly = { tension = 180, friction = 12 } :: SpringOptions, stiff = { tension = 210, friction = 20 } :: Spr...
211
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/tween.luau
local easing = require("./easing") local interpolate = require("./utils/interpolate") local merge = require("./utils/merge") local scheduler = require("./utils/scheduler") local signal = require("./utils/signal") local types = require("./types") type Animatable = types.Animatable type Easing = easing.Easing export ty...
1,432
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/types.luau
export type AnimatablePrimitive = number | vector | Vector3 export type AnimatableType = AnimatablePrimitive | Vector2 | CFrame | Color3 | UDim | UDim2 | Rect export type Animatable = AnimatableType | { [any]: AnimatablePrimitive } return {}
60
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/intermediate.luau
local merge = require("./merge") local oklab = require("./oklab") export type Components = { number | vector | Vector3 } export type Intermediate<T = any> = { components: Components, value: T, dirty: boolean?, encode: (components: Components, value: T) -> (), decode: (components: Components) -> T, } local encod...
1,338
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/interpolate.luau
local oklab = require("./oklab") local types = require("../types") type Animatable = types.Animatable local function interpolate<T>(from: any, to: any, alpha: number): any local kind = typeof(from) if kind == "number" or kind == "vector" or kind == "Vector3" or kind == "Vector2" then return from + (to - from) * ...
458
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/merge.luau
local function merge<T>(target: any, source: any): T local result = target for key, value in source do if target[key] == value then continue end if result == target then result = table.clone(target) end result[key] = value end return result end return merge
77
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/scheduler.luau
export type Scheduler<State> = { states: { State }, update: (state: State, time: number) -> any, step: (deltaTime: number) -> (), add: (state: State) -> (), remove: (state: State) -> (), clear: () -> (), } local function scheduler<State>( label: string, updater: (state: State, time: number, remove: (State) -> ...
399
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/signal.luau
local spawn = require("./spawn") export type FireSignal<T...> = (T...) -> () export type SubscribeSignal<T...> = (callback: FireSignal<T...>) -> () -> () local function signal<T...>(): (SubscribeSignal<T...>, FireSignal<T...>) local listeners: { (...any) -> () } = {} local count = 0 local function subscribe(callb...
198
littensy/ripple
littensy-ripple-c33bb8b/packages/ripple/src/utils/spawn.luau
local freeThread: thread? local function run<T...>(thread: thread, fn: (T...) -> (), ...: T...) freeThread = nil fn(...) freeThread = thread end local function runner() while true do run(coroutine.yield()) end end local function spawn<T...>(callback: (T...) -> (), ...: T...) local thread = freeThread or task...
134
littensy/ripple
littensy-ripple-c33bb8b/packages/vide-ripple/src/__tests__/useMotion.test.luau
local Ripple = require("../../Ripple") local Vide = require("../../Vide") local test = require("../../../../tests/test") local useMotion = require("../useMotion") test("should update binding when goal is set", function() local src, motion Vide.root(function() src, motion = useMotion(0) motion:setGoal(1, { tween...
117
littensy/ripple
littensy-ripple-c33bb8b/packages/vide-ripple/src/__tests__/useTween.test.luau
local Ripple = require("../../Ripple") local Vide = require("../../Vide") local test = require("../../../../tests/test") local useTween = require("../useTween") test("should update binding when goal is set", function() local src, tween Vide.root(function() src, tween = useTween(0) tween:setGoal(1, { tween = { d...
118
littensy/ripple
littensy-ripple-c33bb8b/packages/vide-ripple/src/useMotion.luau
local Ripple = require(script.Parent.Parent.Ripple) local Vide = require(script.Parent.Parent.Vide) type Animatable = Ripple.Animatable type Motion<T> = Ripple.Motion<T> type MotionOptions<T> = Ripple.MotionOptions<T> local function useMotion<T>(initialValue: T, initialOptions: MotionOptions<T>?): (() -> T, Motion<T>...
154
littensy/ripple
littensy-ripple-c33bb8b/packages/vide-ripple/src/useTween.luau
local Ripple = require(script.Parent.Parent.Ripple) local Vide = require(script.Parent.Parent.Vide) type Animatable = Ripple.Animatable type Tween<T> = Ripple.Tween<T> type TweenOptions<T> = Ripple.TweenOptions<T> local function useTween<T>(initialValue: T, initialOptions: TweenOptions<T>?): (() -> T, Tween<T>) loca...
152
littensy/ripple
littensy-ripple-c33bb8b/storybook/components/Graph.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage["@rbxts-js"].React) type GraphProps = { name: string, precision: number, step: (dt: number) -> number, idle: () -> boolean, showRuntime: boolean?, } local MAX_POINTS = 50 local function Graph(props: GraphProp...
814
littensy/ripple
littensy-ripple-c33bb8b/storybook/stories/EasingFunctions.story.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Graph = require(script.Parent.Parent.components.Graph) local React = require(ReplicatedStorage["@rbxts-js"].React) local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox) local Ripple = require(ReplicatedStorage.packages.ripple.src) ...
434
littensy/ripple
littensy-ripple-c33bb8b/storybook/stories/SpringColor.story.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage["@rbxts-js"].React) local ReactRipple = require(ReplicatedStorage.packages["react-ripple"].src) local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox) local function Story() local _, tween = ReactR...
354
ryanlua/satchel
ryanlua-satchel-ee5b2c9/models/SatchelLoader/init.client.luau
--[[ 💖 Thanks for using Satchel 💖 Satchel is a modern open-source alternative to Roblox's default backpack 🎒 📰 DevForum: https://devforum.roblox.com/t/2451549 🛍️ Creator Store: https://create.roblox.com/store/asset/13947506401 🛝 Playground: https://www.roblox.com/join/bxsl5 ]] require(script.Satchel)
105
ryanlua/satchel
ryanlua-satchel-ee5b2c9/src/Attribution.client.luau
--!strict --[[ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ]] --[[ By using Satchel, you agree to provide attribution in one of the following ways: 1. Keep the Att...
230
ryanlua/satchel
ryanlua-satchel-ee5b2c9/src/init.luau
--!nolint DeprecatedApi --[[ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ]] local ContextActionService = game:GetService("ContextActionService") local GuiService = ga...
18,993
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/ExternalTime.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Outputs the current external time as a state object. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Package.External) -- Graph local change = ...
545
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/Stopwatch.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ State object for measuring time since an event using a reference timer. TODO: this should not be exposed to users until it has a proper reactive API surface ]] local Package = script.Parent.Pare...
743
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/Tween.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A specialised state object for following a goal state smoothly over time, using a TweenInfo to shape the motion. https://elttob.uk/Fusion/0.3/api-reference/animation/types/tween/ ]] local Packag...
1,344
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/getTweenDuration.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Given a `tweenInfo`, returns how many seconds it will take before the tween finishes moving. The result may be infinite if the tween repeats forever. ]] local TweenService = game:GetService("Tween...
174
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/getTweenRatio.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 getTweenRati...
336
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/lerpType.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 ...
1,523
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/packType.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Packs an array of numbers into a given animatable data type. If the type is not animatable, nil will be returned. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local...
842
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/springCoefficients.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Returns a 2x2 matrix of coefficients for a given time, damping and angular frequency (aka 'speed'). Specifically, this returns four coefficients - posPos, posVel, velPos, and velVel - which can...
740
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Animation/unpackType.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Unpacks an animatable type into an array of numbers. If the type is not animatable, an empty array will be returned. ]] local Package = script.Parent.Parent local Oklab = require(Package.Colour.Ok...
856
dphfox/Fusion
dphfox-Fusion-2790f7b/src/External.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Abstraction layer between Fusion internals and external environments, allowing for flexible integration with schedulers and test mocks. ]] local Package = script.Parent local formatError = require...
860
dphfox/Fusion
dphfox-Fusion-2790f7b/src/ExternalDebug.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Abstraction layer between Fusion internals and external debuggers, allowing for deep introspection using function hooks. Unlike `External`, attaching a debugger is optional, and all debugger fun...
409
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Graph/Observer.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A graph object that runs user code when it's updated by the reactive graph. http://elttob.uk/Fusion/0.3/api-reference/state/types/observer/ ]] local Package = script.Parent.Parent local Types = r...
635
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Graph/castToGraph.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Returns the input *only* if it is a graph object. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local function castToGraph( target: any ): Types.GraphObject? if ...
165
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Graph/change.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Prompts a graph object to re-evaluate its own value. If it meaningfully changes, then dependents will have to re-evaluate their own values in the future. https://fluff.blog/2024/04/16/monotonic-...
592
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Graph/depend.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Forms a dependency on a graph object. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Package.External) local evaluate = require(Package.Graph....
245
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Graph/evaluate.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Evaluates the graph object if necessary, so that it is up to date. Returns true if it meaningfully changed. https://fluff.blog/2024/04/16/monotonic-painting.html ]] local Package = script.Parent...
378
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Attribute.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A special key for property tables, which allows users to apply custom attributes to instances ]] local Package = script.Parent.Parent local Types = require(Package.Types) -- Memory local checkLife...
354
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/AttributeChange.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A special key for property tables, which allows users to connect to an attribute change on an instance. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External ...
294
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/AttributeOut.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A special key for property tables, which allows users to save instance attributes into state objects ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = r...
408
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Child.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Helper function for type checking purposes. Casts the input to a `Child` type, while constraining the input to be an array of `Child` - this prevents Luau from erroneously inferring a different ar...
126
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Children.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A special key for property tables, which parents any given descendants into an instance. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Packa...
1,058
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Hydrate.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 Types = require(...
152
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/New.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 Types = re...
318
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/OnChange.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Constructs special keys for property tables which connect property change listeners to an instance. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = re...
319
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/OnEvent.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Constructs special keys for property tables which connect event listeners to an instance. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Pack...
327
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Out.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 Types = require(P...
439
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/Tag.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A special key for property tables, which allows users to apply custom CollectionService tags to instances ]] local Package = script.Parent.Parent local Types = require(Package.Types) -- Memory loc...
400
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/applyInstanceProps.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 no...
1,039
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Instances/defaultProps.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Stores 'sensible default' properties to be applied to instances created by the New function. ]] return { ScreenGui = { ResetOnSpawn = false, ZIndexBehavior = Enum.ZIndexBehavior.Sibling }, ...
1,400
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Logging/formatError.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Formats a Fusion-specific error message. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local messages = require(Package.Logging.messages) local ERROR_INFO_URL = "htt...
394
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Logging/parseError.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ An xpcall() error handler to collect and parse useful information about errors, such as clean messages and stack traces. ]] local Package = script.Parent.Parent local Types = require(Package.Types...
138
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/checkLifetime.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Procedures for checking lifetimes and printing helpful warnings about them. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = require(Package.External)...
958
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/deriveScope.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Creates an empty scope with the same metatables as the original scope. Used for preserving access to constructors when creating inner scopes. This is the public version of the function, which imp...
156
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/deriveScopeImpl.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Creates an empty scope with the same metatables as the original scope. Used for preserving access to constructors when creating inner scopes. This is the internal version of the function, which d...
258
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/doCleanup.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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 ...
670
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/innerScope.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Derives a new scope that's destroyed exactly once, whether by the user or by the scope that it's inside of. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local Extern...
211
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/insert.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Inserts clean up tasks passed in to the scope. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local function insert<Tasks...>( scope: Types.Scope<unknown>, ...: Task...
117
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/needsDestruction.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Returns true if the given value is not automatically memory managed, and requires manual cleanup. ]] local function needsDestruction( x: unknown ): boolean return typeof(x) == "Instance" end re...
83
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Memory/scoped.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Creates cleanup tables with access to constructors as methods. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local ExternalDebug = require(Package.ExternalDebug) loca...
148
dphfox/Fusion
dphfox-Fusion-2790f7b/src/RobloxExternal.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow --[[ Roblox implementation for Fusion's abstract provider layer. ]] local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local Package = script.Parent local External = require(Package.External) local RobloxExternal...
504
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/Computed.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A specialised state object for tracking single values computed from a user-defined computation. https://elttob.uk/Fusion/0.3/api-reference/state/types/computed/ ]] local Package = script.Parent....
854
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/For/Disassembly.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Breaks down an input table into reactive sub-objects for each pair. ]] local Package = script.Parent.Parent.Parent local Types = require(Package.Types) local External = require(Package.External) --...
1,581
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/For/ForTypes.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Stores types that are commonly used between For objects. ]] local Package = script.Parent.Parent.Parent local Types = require(Package.Types) export type SubObject<S, KI, KO, VI, VO> = { -- Not al...
272
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/For/init.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ The generic implementation for all `For` objects. ]] local Package = script.Parent.Parent local Types = require(Package.Types) -- Graph local depend = require(Package.Graph.depend) -- State local p...
650
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/ForKeys.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Constructs and returns a new For state object which processes keys and preserves values. https://elttob.uk/Fusion/0.3/api-reference/state/members/forkeys/ TODO: the sub objects constructed here...
645
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/ForPairs.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Constructs and returns a new For state object which processes keys and values in pairs. https://elttob.uk/Fusion/0.3/api-reference/state/members/forpairs/ TODO: the sub objects constructed here...
725
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/ForValues.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Constructs and returns a new For state object which processes values and preserves keys. https://elttob.uk/Fusion/0.3/api-reference/state/members/forvalues/ TODO: the sub objects constructed he...
633
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/Value.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A state object which allows regular Luau code to control its value. https://elttob.uk/Fusion/0.3/api-reference/state/types/value/ ]] local Package = script.Parent.Parent local Types = require(Pac...
464
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/castToState.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Returns the input *only* if it is a state object. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local function castToState<T>( target: Types.UsedAs<T> ): Types.Stat...
128
dphfox/Fusion
dphfox-Fusion-2790f7b/src/State/peek.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Extracts a value of type T from its input. https://elttob.uk/Fusion/0.3/api-reference/state/members/peek/ ]] local Package = script.Parent.Parent local Types = require(Package.Types) -- State loc...
185
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Types.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Stores common public-facing type information for Fusion APIs. ]] export type Error = { type: "Error", raw: string, message: string, trace: string, context: string? } -- Types that can be expr...
3,296
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/Contextual.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Time-based contextual values, to allow for transparently passing values down the call stack. ]] local Package = script.Parent.Parent local Types = require(Package.Types) local External = requir...
562
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/Safe.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ A variant of xpcall() designed for inline usage, letting you define fallback values based on caught errors. ]] local Package = script.Parent.Parent local function Safe<Success, Fail>( callbac...
128
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/isSimilar.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Implements the 'similarity test' used to determine whether two values have a meaningful difference. https://elttob.uk/Fusion/0.3/tutorials/best-practices/optimisation/#similarity ]] local functi...
208
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/merge.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Attempts to merge a variadic number of tables together. ]] local Package = script.Parent.Parent local External = require(Package.External) local function merge( overwrite: boolean, into: {[unkno...
196
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/nameOf.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Returns the most specific custom name for the given object. ]] local Package = script.Parent.Parent -- Utility local nicknames = require(Package.Utility.nicknames) local function nameOf( x: unkno...
196
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/never.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Never returns. ]] local function never(): never error("This codepath should not be reachable") end return never
61
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/nicknames.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ Stores nicknames for values that don't support metatables, so that `nameOf` can return values for them. ]] return setmetatable({}, {__mode = "k"})
73
dphfox/Fusion
dphfox-Fusion-2790f7b/src/Utility/xtypeof.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ 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: unknown )...
142
dphfox/Fusion
dphfox-Fusion-2790f7b/src/init.luau
--!strict --!nolint LocalUnused --!nolint LocalShadow local task = nil -- Disable usage of Roblox's task scheduler --[[ The entry point for the Fusion library. ]] local Types = require(script.Types) local External = require(script.External) type Fusion = Types.Fusion export type Animatable = Types.Animatable export...
638
sircfenner/StudioComponents
sircfenner-StudioComponents-ceb9d45/src/CommonProps.luau
--[=[ @class CommonProps @private The props listed here are accepted by every component except where explicitly noted. These props are accepted in addition to the props specified by components on their API pages. :::info This file is not exported and serves only to host an internal type and documentation. ::: ...
172
sircfenner/StudioComponents
sircfenner-StudioComponents-ceb9d45/src/Components/Background.luau
--[=[ @class Background A borderless frame matching the default background color of Studio widgets. | Dark | Light | | - | - | | ![Dark](/StudioComponents/components/background/dark.png) | ![Light](/StudioComponents/components/background/light.png) | Any children passed will be parented to the frame, which ma...
317