/** * @license * Copyright 2024 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import { LitElement } from 'lit'; import type { PresenceUser } from './presence.types.js'; import './presence-avatars.component.js'; import './presence-chat.component.js'; declare const NrPresenceElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & (new (...args: any[]) => import("packages/common/src/shared/base-mixin.js").LightDomContent) & typeof LitElement; /** * Top-level presence orchestrator. * * Owns the resource socket for viewer tracking, and uses the global messages * socket (`.globalSocket`) for real-time chat. * * Two chat modes: * - **Group chat**: One conversation per resource. Opened via the chat button. * - **DM**: Private 1-on-1 conversation. Opened by clicking a viewer's avatar. * * @example * ```html * * ``` * * @fires presence-changed - Fires when viewer list updates. Detail: `{ viewers: PresenceUser[] }` */ export declare class NrPresenceElement extends NrPresenceElement_base { static styles: import("lit").CSSResult[]; static useShadowDom: boolean; /** Socket.io namespace for presence tracking */ namespace: string; /** Socket.io path */ socketPath: string; /** The resource being viewed (workflow id, doc id, etc.) */ resourceId: string; /** Resource type for group conversation (e.g. 'workflow', 'whiteboard') */ resourceType: string; /** Resource name (used as group conversation name) */ resourceName: string; /** Current user's id */ userId: string; /** Current user object (shown first in avatar strip) */ currentUser: PresenceUser | null; /** Additional users to show (e.g. mocks for demo) */ extraUsers: PresenceUser[]; /** Global messages socket (from layout's /nk/messages connection) for real-time chat */ globalSocket: any; private _viewers; private _hasUnreadGroup; private _socket; private _connecting; private _chats; private _chatZ; private _drag; private _boundDragMove; private _boundDragEnd; private _boundEscape; private _boundOnMessage; connectedCallback(): void; disconnectedCallback(): void; updated(changed: Map): void; private _attachGlobalSocket; private _detachGlobalSocket; /** Handle incoming messages from the global /nk/messages socket */ private _onSocketMessage; private _connect; private _groupConversationId; private _openGroupChat; private _openDm; private _loadMessages; private _sendMessage; private _closeChat; private _onEscape; private _onDragStart; private _onDragMove; private _onDragEnd; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'nr-presence': NrPresenceElement; } } export {}; //# sourceMappingURL=presence.component.d.ts.map