yjs
npmBidirectional Angular Signal bindings for Yjs CRDT real-time collaborative state.
import { yjsSignal, YjsDocService } from '@angular-helpers/yjs';
const yjs = inject(YjsDocService);
const yMap = yjs.doc.getMap('doc');
const title = yjsSignal(yMap, { key: 'title' });π Signals & State
yjsSignal
Creates a bidirectional Angular WritableSignal synchronized with Yjs CRDT types (Y.Map, Y.Array, Y.Text). Features non-destructive delta reconciliation, recursive nested CRDT structure preservation, key-level mapping, and configurable batching. Fully interoperable as a model driver for Angular Signal Forms (@angular/forms/signals).
injectYjsUndoManager
Creates a reactive Angular adapter for Yjs UndoManager. Exposes canUndo and canRedo read-only Signals to easily bind undo/redo UI buttons in collaborative editors. Automatically tracks local signal and directive edits by default.
injectYjsAwareness
Connects an Angular component or service to a Yjs Awareness protocol instance. Exposes reactive signals for local presence, active remote collaborators, and cursor/state updates with automatic tab visibility resync and phantom cleanup.
injectYjsWebsocket
Connects a Y.Doc to a y-websocket server. Exposes status() and isSynced() read-only Signals to track real-time WebSocket connection state.
injectYjsIndexeddb
Persists a Y.Doc to local IndexedDB storage using y-indexeddb. Exposes reactive isHydrated, isHydrating, and synced Signals to easily guard SSR hydration and @defer blocks.
YjsTextDirective
Angular directive that binds a Y.Text CRDT instance to an or element. Automatically synchronizes collaborative edits bidirectionally and retains cursor and selection position across concurrent remote changes.
YjsDocService
Injectable Angular service providing a managed singleton Y.Doc instance with lifecycle management and cleanup helpers.