charm/src/types.luau
2024-03-27 23:49:33 -07:00

16 lines
345 B
Lua

export type WeakMap<K, V> = typeof(setmetatable({} :: { [K]: V }, { __mode = "k" }))
export type Atom<T> = (() -> T) & (state: T | (T) -> T) -> T
export type Source<T> = () -> T
export type AtomOptions<T> = {
equals: (prev: T, next: T) -> boolean,
}
export type SyncPayload = {
type: "patch" | "init",
data: { [any]: any },
}
return nil