This commit is contained in:
aaron 2023-07-30 14:35:46 +01:00
parent 1aa74310f3
commit 676bbbcc00
15 changed files with 665 additions and 873 deletions

View file

@ -6,20 +6,13 @@
if not game then script = (require :: any) "test/wrap-require" end
local create = require(script.create)
local apply = require(script.apply)
local wrap = require(script.wrap)
local watch = require(script.watch)
local derive = require(script.derive)
local map = require(script.map)
local unwrap = require(script.unwrap)
local wrapped = require(script.wrapped)
local Layout = require(script.Layout)
local Children = require(script.Children)
local Event = require(script.Event)
local Changed = require(script.Change)
local Created = require(script.Created)
-- local Changed = require(script.Change)
-- local Created = require(script.Created)
local spring, updateSprings = require(script.spring)()
@ -32,25 +25,20 @@ type Setter<T> = ( (new: T, force: true?) -> T ) & ( (update: (old: T) -> T, for
local vide = {
-- core
create = create,
apply = apply,
wrap = (wrap :: any) :: <T>(value: T?) -> (T, Setter<T>),
derive = (derive :: any) :: <T>(deriver: (from: <U>(U) -> U) -> T, cleanup: (T) -> ()?) -> T,
map = (map :: any) :: ( <V>(input: number, transform: (number) -> V, cleanup: (V) -> ()?) -> Map<number, V> ) & ( <K, VI, VO>(input: Map<K, VI>, transform: (K, VI) -> VO, cleanup: (VO) -> ()?) -> Map<K, VO> ),
watch = watch :: ((Unwrapper) -> ()) -> () -> (),
-- util
unwrap = unwrap,
wrapped = wrapped,
wrap = wrap,
derive = derive,
map = map,
watch = watch,
-- animations
spring = (spring :: any) :: <T>(input: T, period: number, damping: number?) -> T,
spring = spring,
-- symbols
Event = Event,
Changed = Changed,
Layout = Layout,
Children = Children,
Created = Created,
-- Event = Event,
-- Changed = Changed,
-- Layout = Layout,
-- Children = Children,
-- Created = Created,
-- flags
strict = (nil :: any) :: boolean,