createSerializable
Recursively converts JavaScript values into Serializable references that can be passed to different JavaScript Runtimes.
createSynchronizable
Creates a new Synchronizable holding the provided initial value. Returns the created Synchronizable.
isSerializableRef
Asserts whether a value is a Serializable reference.
isSynchronizable
Asserts whether a value is a Synchronizable.
registerCustomSerializable
registerCustomSerializable lets you register your own pre-serialization and post-deserialization logic. This is necessary for objects with prototypes different than just Object.prototype or some other built-in prototypes like Map etc. Worklets can't handle such objects by default to convert into Serializables hence you need to register them as Custom Serializables. This way you can tell Worklets how to transfer your custom data structures between different Runtimes without manually serializing and deserializing them every time.
Serializable
Serializable is a type of shared memory that holds an immutable value that can be serialized and deserialized across different JavaScript Runtimes. It allows passing JavaScript values between Runtimes while ensuring that the data is correctly transferred and reconstructed. The reference cannot be manipulated, as it doesn't represent any standard JavaScript object.
Synchronizable
Synchronizable is a type of shared memory not tied to any JavaScript Runtime. It can be accessed from any JavaScript Runtime and C++. The value held by Synchronizable behaves like a standard JavaScript value.
makeShareable
makeShareable lets you create a Shareable object from a given value on the UI thread.
makeShareableCloneOnUIRecursive
makeShareableCloneOnUIRecursive recursively converts JavaScript values into shareable references that can be used on different Runtimes than UI Runtime.
makeShareableCloneRecursive
makeShareableCloneRecursive recursively converts JavaScript values into shareable references that can be used on different Runtimes than RN Runtime.