import { BaseEvent } from "./base_event.js"; export declare const protobufPackage = "materi.events.v1"; export declare enum OperationType { OPERATION_TYPE_UNSPECIFIED = "OPERATION_TYPE_UNSPECIFIED", INSERT = "INSERT", DELETE = "DELETE", FORMAT = "FORMAT", MOVE = "MOVE", REPLACE = "REPLACE", UNRECOGNIZED = "UNRECOGNIZED" } export declare function operationTypeFromJSON(object: any): OperationType; export declare function operationTypeToJSON(object: OperationType): string; export declare enum PresenceStatus { PRESENCE_STATUS_UNSPECIFIED = "PRESENCE_STATUS_UNSPECIFIED", ONLINE = "ONLINE", IDLE = "IDLE", OFFLINE = "OFFLINE", UNRECOGNIZED = "UNRECOGNIZED" } export declare function presenceStatusFromJSON(object: any): PresenceStatus; export declare function presenceStatusToJSON(object: PresenceStatus): string; export declare enum LockType { LOCK_TYPE_UNSPECIFIED = "LOCK_TYPE_UNSPECIFIED", READ_LOCK = "READ_LOCK", WRITE_LOCK = "WRITE_LOCK", EXCLUSIVE_LOCK = "EXCLUSIVE_LOCK", UNRECOGNIZED = "UNRECOGNIZED" } export declare function lockTypeFromJSON(object: any): LockType; export declare function lockTypeToJSON(object: LockType): string; export declare enum UnlockReason { UNLOCK_REASON_UNSPECIFIED = "UNLOCK_REASON_UNSPECIFIED", USER_ACTION = "USER_ACTION", TIMEOUT = "TIMEOUT", SYSTEM = "SYSTEM", UNRECOGNIZED = "UNRECOGNIZED" } export declare function unlockReasonFromJSON(object: any): UnlockReason; export declare function unlockReasonToJSON(object: UnlockReason): string; export declare enum ConflictType { CONFLICT_TYPE_UNSPECIFIED = "CONFLICT_TYPE_UNSPECIFIED", INSERT_INSERT = "INSERT_INSERT", INSERT_DELETE = "INSERT_DELETE", DELETE_DELETE = "DELETE_DELETE", CONCURRENT_EDITS = "CONCURRENT_EDITS", UNRECOGNIZED = "UNRECOGNIZED" } export declare function conflictTypeFromJSON(object: any): ConflictType; export declare function conflictTypeToJSON(object: ConflictType): string; export declare enum ConflictResolution { CONFLICT_RESOLUTION_UNSPECIFIED = "CONFLICT_RESOLUTION_UNSPECIFIED", SERVER_WINS = "SERVER_WINS", CLIENT_WINS = "CLIENT_WINS", MERGED = "MERGED", MANUAL = "MANUAL", UNRECOGNIZED = "UNRECOGNIZED" } export declare function conflictResolutionFromJSON(object: any): ConflictResolution; export declare function conflictResolutionToJSON(object: ConflictResolution): string; /** OperationAppliedEvent - Published when a collaborative operation is applied */ export interface OperationAppliedEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Operation fields */ operationId: string; documentId: string; userId: string; appliedAt?: Date | undefined; /** Operation details */ operationType: OperationType; position: number; content: string; /** For delete operations */ length?: number | undefined; /** Operational Transform metadata */ vectorClock?: VectorClock | undefined; serverVersion: number; /** IDs of concurrent operations */ concurrentOperations: string[]; /** Formatting (optional) */ attributes: { [key: string]: string; }; } export interface OperationAppliedEvent_AttributesEntry { key: string; value: string; } /** PresenceUpdateEvent - Published when user presence changes */ export interface PresenceUpdateEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Presence fields */ documentId: string; userId: string; updatedAt?: Date | undefined; /** Presence details */ status: PresenceStatus; cursor?: CursorPosition | undefined; selection?: SelectionRange | undefined; viewport?: ViewportInfo | undefined; /** User info */ username: string; avatarUrl: string; /** Hex color for cursor/selection */ color: string; } /** CursorMovedEvent - Published when a user's cursor moves */ export interface CursorMovedEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Cursor fields */ documentId: string; userId: string; movedAt?: Date | undefined; /** Cursor position */ position?: CursorPosition | undefined; /** Throttling metadata */ throttled: boolean; } /** DocumentLockedEvent - Published when a document is locked for editing */ export interface DocumentLockedEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Lock fields */ documentId: string; lockedBy: string; lockedAt?: Date | undefined; /** Lock details */ lockType: LockType; expiresAt?: Date | undefined; reason: string; } /** DocumentUnlockedEvent - Published when a document lock is released */ export interface DocumentUnlockedEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Lock fields */ documentId: string; unlockedBy: string; unlockedAt?: Date | undefined; /** Unlock details */ reason: UnlockReason; /** Operations applied during lock */ operationsApplied: number; } /** ConflictDetectedEvent - Published when an operational transform conflict occurs */ export interface ConflictDetectedEvent { /** Base event fields */ base?: BaseEvent | undefined; /** Conflict fields */ documentId: string; detectedAt?: Date | undefined; /** Conflicting operations */ operationIds: string[]; conflictType: ConflictType; resolution: ConflictResolution; /** Resolution metadata */ resolvedBy: string; resolutionStrategy: string; } export interface VectorClock { serverVersion: number; /** client_id -> version */ clientVersions: { [key: string]: number; }; } export interface VectorClock_ClientVersionsEntry { key: string; value: number; } export interface CursorPosition { line: number; column: number; /** Character offset from start */ offset: number; } export interface SelectionRange { start?: CursorPosition | undefined; end?: CursorPosition | undefined; /** Selection direction */ isForward: boolean; } export interface ViewportInfo { topLine: number; bottomLine: number; visibleLines: number; } export declare const OperationAppliedEvent: MessageFns; export declare const OperationAppliedEvent_AttributesEntry: MessageFns; export declare const PresenceUpdateEvent: MessageFns; export declare const CursorMovedEvent: MessageFns; export declare const DocumentLockedEvent: MessageFns; export declare const DocumentUnlockedEvent: MessageFns; export declare const ConflictDetectedEvent: MessageFns; export declare const VectorClock: MessageFns; export declare const VectorClock_ClientVersionsEntry: MessageFns; export declare const CursorPosition: MessageFns; export declare const SelectionRange: MessageFns; export declare const ViewportInfo: MessageFns; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends { $case: string; } ? { [K in keyof Omit]?: DeepPartial; } & { $case: T["$case"]; } : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact; } & { [K in Exclude>]: never; }; export interface MessageFns { fromJSON(object: any): T; toJSON(message: T): unknown; create, I>>(base?: I): T; fromPartial, I>>(object: I): T; } export {}; //# sourceMappingURL=collaboration_events.d.ts.map