Fabric.js canvas instance
OptionalcurrentCurrent drawing color (to save)
OptionalenableWhether auto-save is enabled
File ID to load/save
OptionalgetReturn extra data to merge into the file on save (e.g., background pages)
OptionalgetReturns the ms timestamp of the most recent remote message
applied to the canvas, or 0 if none. The autosave defers when a
remote update arrived in the last REMOTE_QUIESCENT_MS window —
otherwise the save can capture a half-applied snapshot (e.g., the
owner saves while a peer's OBJECT_ADDED is still being applied)
and the persisted file misses peer changes.
OptionalinitialInitial file data for newly created whiteboards. When provided, the whiteboard will initialize with this data instead of fetching from the server.
Whether the current user is the owner
OptionalonCalled after load
OptionalonCalled after save
OptionalonCalled before load to set suppress state
OptionalonCalled before save to set suppress state
OptionalonCalled when an async operation fails
OptionalonCalled when the load fails (network, parse error, etc.). Fires
INSTEAD of onAfterLoad. Consumers must symmetrically reset any
state they set in onBeforeLoad (suppress-broadcast, loading
flags) — without this, a transient load failure leaves the
whiteboard wedged in suppressed state for the rest of the
session: broadcasts dropped, undo broken, autosave deferred.
OptionalonCalled when object is loaded
OptionalownerWhether the file owner is currently active in the room. When the
owner is absent, non-owners are allowed to save so their work
isn't lost if the owner never reopens the board this session. When
the owner is present, non-owners defer to the owner's authoritative
save. Sourced from useWhiteboardSync.ownerPresent.
OptionalrelayWhether a live collaboration relay is connected for this file.
Used to relax the save permission for standalone editing
(library, no <SemanticRelayProvider>): when the relay isn't
connected, the local user is the sole authoritative editor for
this session and is allowed to save even if they aren't the
file's owner — otherwise their edits would be silently lost.
Inside a live lesson (relay connected), only the owner saves to
avoid concurrent-write races against the owner's autosave —
unless the owner is currently absent (see ownerPresent).
OptionalstylesCustom styles
User ID
Options for the useWhiteboardFile hook