Skip to content

DocumentGateway

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api/src/gateway/document.gateway.ts

Implements: OnGatewayConnection, OnGatewayDisconnect

Methods

MethodSignatureReturns
handleConnectionhandleConnection(client: Socket)void
handleDisconnecthandleDisconnect(client: Socket)void
handleJoinDocumenthandleJoinDocument(data: { documentId: string; userId: string; userName: string }, client: Socket)void
handleLeaveDocumenthandleLeaveDocument(data: { documentId: string }, client: Socket)void
handleCursorUpdatehandleCursorUpdate(data: { documentId: string; position: any }, client: Socket)void
handleSelectionUpdatehandleSelectionUpdate(data: { documentId: string; selection: any }, client: Socket)void
emitToDocumentemitToDocument(documentId: string, event: string, data: any)void
getDocumentUsersgetDocumentUsers(documentId: string)UserPresence[]
getDocumentConnectionCountgetDocumentConnectionCount(documentId: string)number

Properties

PropertyType
serverServer

Where it refuses work

  • DocumentGateway stops the work with an early return when !presenceMap.

Referenced By

  • CommentService (DEPENDS_ON)
  • GatewayModule (MODULE_PROVIDES)
  • GatewayModule (MODULE_EXPORTS)
  • SuggestionService (DEPENDS_ON)

Was this page helpful?

Download as PDF