@rbxts/charm
Advanced tools
Comparing version 0.6.1 to 0.6.2
{ | ||
"name": "@rbxts/charm", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Atomic state management for Roblox", | ||
@@ -5,0 +5,0 @@ "main": "src/init.lua", |
@@ -53,2 +53,3 @@ export = Charm; | ||
type AtomMap = Record<string, Atom<any>>; | ||
type MoleculeMap = Record<string, Molecule<any>>; | ||
@@ -229,3 +230,3 @@ interface AtomOptions<State> { | ||
*/ | ||
server: <Atoms extends AtomMap>(options: ServerOptions<Atoms>) => ServerSyncer<Atoms>; | ||
server: <Molecules extends MoleculeMap>(options: ServerOptions<Molecules>) => ServerSyncer<Molecules>; | ||
/** | ||
@@ -285,5 +286,5 @@ * Checks whether a value is `None`. If `true`, the value is scheduled to be | ||
*/ | ||
type SyncPayload<Atoms extends AtomMap> = | ||
| { type: "init"; data: StateOfMap<Atoms> } | ||
| { type: "patch"; data: SyncPatch<StateOfMap<Atoms>> }; | ||
type SyncPayload<Molecules extends MoleculeMap> = | ||
| { type: "init"; data: StateOfMap<Molecules> } | ||
| { type: "patch"; data: SyncPatch<StateOfMap<Molecules>> }; | ||
@@ -297,7 +298,7 @@ interface ClientOptions<Atoms extends AtomMap> { | ||
interface ServerOptions<Atoms extends AtomMap> { | ||
interface ServerOptions<Molecules extends MoleculeMap> { | ||
/** | ||
* The atoms to synchronize with the client. | ||
*/ | ||
atoms: Atoms; | ||
atoms: Molecules; | ||
/** | ||
@@ -331,3 +332,3 @@ * The interval at which to send patches to the client, in seconds. | ||
interface ServerSyncer<Atoms extends AtomMap> { | ||
interface ServerSyncer<Molecules extends MoleculeMap> { | ||
/** | ||
@@ -344,3 +345,3 @@ * Sets up a subscription to each atom that schedules a patch to be sent to | ||
*/ | ||
connect(callback: (player: Player, ...payloads: SyncPayload<Atoms>[]) => void): Cleanup; | ||
connect(callback: (player: Player, ...payloads: SyncPayload<Molecules>[]) => void): Cleanup; | ||
/** | ||
@@ -347,0 +348,0 @@ * Hydrates the client's state with the server's state. This should be |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59895
314