vide/test/syntax.luau
Aaron Smith 7cdcebf03c
2023-08-02 16:12:05 +01:00

43 lines
776 B
Lua

local vide = require "src/init"
local source = vide.source
local derive = vide.derive
local map = vide.map
local create = vide.create
type Action<T> = {
type: T,
priority: number,
callback: (Instance) -> ()
}
local function processor(priority: number, fn: (Instance) -> ()): Action<any>
end
local function Changed(property: string, callback: () -> ())
return processor(1, function(instance)
instance:GetPropertyChangedSignal(property):Connect(callback)
end) :: Action<"Changed">
end
local function Cleanup(t: {})
end
function TextInput(p: {
OnInput: Action<"Changed">
})
create "TextBox" {
Text = "test",
Changed("Text", function()
end),
Cleanup {
},
create("Frame") {}
}
end