UNPKG

treesap

Version:
46 lines 1.5 kB
import { EventEmitter } from 'events'; import * as pty from 'node-pty'; export interface TerminalSession { id: string; process: pty.IPty; eventEmitter: EventEmitter; createdAt: Date; lastActivity: Date; cwd?: string; env?: Record<string, string>; cols?: number; rows?: number; } export interface PersistedSessionData { id: string; createdAt: string; lastActivity: string; cwd: string; env: Record<string, string>; cols: number; rows: number; } export declare class TerminalService { private static sessions; private static readonly SESSION_TIMEOUT; private static readonly PERSISTENCE_DIR; private static readonly SESSIONS_FILE; static createSession(sessionId: string, options?: { cwd?: string; cols?: number; rows?: number; }): TerminalSession; static getSession(sessionId: string): TerminalSession | undefined; static executeCommand(sessionId: string, command: string): boolean; static destroySession(sessionId: string): boolean; static getAllSessions(): TerminalSession[]; static cleanupExpiredSessions(): number; private static scheduleSessionCleanup; static setupGlobalCleanup(): void; private static ensurePersistenceDir; private static persistSessionData; private static removePersistedSession; private static loadPersistedSessions; static updateSessionActivity(sessionId: string): void; } //# sourceMappingURL=terminal.d.ts.map