--!strict --[[ The entry point for the Fusion library. ]] local PubTypes = require "./PubTypes" local External = require "./External" local restrictRead = require "./Utility/restrictRead" -- Down the line, this will be conditional based on whether Fusion is being -- compiled for Mercury. do local MercuryExternal = require "./MercuryExternal" External.setExternalScheduler(MercuryExternal) end local Fusion = restrictRead("Fusion", { version = { major = 0, minor = 3, isRelease = false }, New = require "./Instances/New", Hydrate = require "./Instances/Hydrate", Ref = require "./Instances/Ref", Out = require "./Instances/Out", Cleanup = require "./Instances/Cleanup", Children = require "./Instances/Children", OnEvent = require "./Instances/OnEvent", OnChange = require "./Instances/OnChange", Value = require "./State/Value", Computed = require "./State/Computed", ForPairs = require "./State/ForPairs", ForKeys = require "./State/ForKeys", ForValues = require "./State/ForValues", Observer = require "./State/Observer", Tween = require "./Animation/Tween", Spring = require "./Animation/Spring", Contextual = require "./Utility/Contextual", cleanup = require "./Utility/cleanup", doNothing = require "./Utility/doNothing", peek = require "./State/peek", typeof = require "../../Modules/Polyfill/typeof", TweenInfo = require "../../Modules/Polyfill/TweenInfo", Help = function() return "See https://elttob.uk/Fusion/0.3/ for more information." end, }) :: Fusion export type StateObject = PubTypes.StateObject export type CanBeState = PubTypes.CanBeState export type Symbol = PubTypes.Symbol export type Value = PubTypes.Value export type Computed = PubTypes.Computed export type ForPairs = PubTypes.ForPairs export type ForKeys = PubTypes.ForKeys export type ForValues = PubTypes.ForKeys export type Observer = PubTypes.Observer export type Tween = PubTypes.Tween export type Spring = PubTypes.Spring export type Use = PubTypes.Use export type Contextual = PubTypes.Contextual type Fusion = { version: PubTypes.Version, New: ( className: string ) -> (propertyTable: PubTypes.PropertyTable) -> Instance, Hydrate: ( target: Instance ) -> (propertyTable: PubTypes.PropertyTable) -> Instance, Ref: PubTypes.SpecialKey, Cleanup: PubTypes.SpecialKey, Children: PubTypes.SpecialKey, Out: (propertyName: string) -> PubTypes.SpecialKey, OnEvent: (eventName: string) -> PubTypes.SpecialKey, OnChange: (propertyName: string) -> PubTypes.SpecialKey, Value: (initialValue: T) -> Value, Computed: (callback: (Use) -> T, destructor: (T) -> ()?) -> Computed, ForPairs: ( inputTable: CanBeState<{ [KI]: VI }>, processor: (Use, KI, VI) -> (KO, VO, M?), destructor: (KO, VO, M?) -> ()? ) -> ForPairs, ForKeys: ( inputTable: CanBeState<{ [KI]: any }>, processor: (Use, KI) -> (KO, M?), destructor: (KO, M?) -> ()? ) -> ForKeys, ForValues: ( inputTable: CanBeState<{ [any]: VI }>, processor: (Use, VI) -> (VO, M?), destructor: (VO, M?) -> ()? ) -> ForValues, Observer: (watchedState: StateObject) -> Observer, Tween: (goalState: StateObject, tweenInfo: TweenInfo?) -> Tween, Spring: ( goalState: StateObject, speed: CanBeState?, damping: CanBeState? ) -> Spring, Contextual: (defaultValue: T) -> Contextual, cleanup: (...any) -> (), doNothing: (...any) -> (), peek: Use, } return Fusion