import type { User } from '@n8n/db'; import type { Workflow } from 'n8n-workflow'; import { CacheService } from '@n8n/backend-services'; interface CacheEntry { userId: string; lastSeen: string; clientId: string; } export interface WriteLock { clientId: string; userId: string; } export declare class CollaborationState { private readonly cache; readonly inactivityCleanUpTime: number; constructor(cache: CacheService); private lockChains; private serializeLockOp; addCollaborator(workflowId: Workflow['id'], userId: User['id'], clientId: string): Promise; removeCollaborator(workflowId: Workflow['id'], clientId: string): Promise; getCollaborators(workflowId: Workflow['id']): Promise; private formWorkflowCacheKey; private splitToExpiredAndStillActive; private removeExpiredCollaborators; private parseCacheHashToCollaborators; private hasSessionExpired; readonly writeLockTtl: number; setWriteLock(workflowId: Workflow['id'], clientId: string, userId: User['id']): Promise; acquireWriteLock(workflowId: Workflow['id'], clientId: string, userId: User['id']): Promise; renewWriteLock(workflowId: Workflow['id'], clientId: string, userId: User['id']): Promise; private isHeldBy; private parseLock; getWriteLock(workflowId: Workflow['id']): Promise; releaseWriteLock(workflowId: Workflow['id']): Promise; releaseWriteLockIfHolder(workflowId: Workflow['id'], clientId: string, userId: User['id']): Promise; private formWriteLockCacheKey; acquireWriteLockForce(workflowId: Workflow['id'], clientId: string, userId: User['id']): Promise; addAgentCollaborator(agentId: string, userId: User['id'], clientId: string): Promise; removeAgentCollaborator(agentId: string, clientId: string): Promise; getAgentCollaborators(agentId: string): Promise; private formAgentCacheKey; private removeExpiredAgentCollaborators; setAgentWriteLock(agentId: string, clientId: string, userId: User['id']): Promise; acquireAgentWriteLock(agentId: string, clientId: string, userId: User['id']): Promise; renewAgentWriteLock(agentId: string, clientId: string, userId: User['id']): Promise; getAgentWriteLock(agentId: string): Promise; getAgentWriteLocks(agentIds: string[]): Promise>; releaseAgentWriteLock(agentId: string): Promise; releaseAgentWriteLockIfHolder(agentId: string, clientId: string, userId: User['id']): Promise; private formAgentWriteLockCacheKey; acquireAgentWriteLockForce(agentId: string, clientId: string, userId: User['id']): Promise; } export {};