Skip to content

Function: serialize()

ts
function serialize(viewer): ViewerStateV1;

Defined in: src/serialization/StateSerializer.ts:25

Serialize a NeuroSurfaceViewer into a portable JSON state object.

The viewer is accessed via duck-typing to avoid circular imports. Components that implement toStateJSON() are preferred; otherwise the serializer reads public fields directly.

Parameters

viewer

any

Returns

ViewerStateV1

Released under the MIT License.