hudada-cli
Version:
专为程序员准备的本地文档搜索,快捷开发工具
44 lines (43 loc) • 1.2 kB
TypeScript
export type SSHConnection = {
id?: number;
name: string;
host: string;
port: number;
username: string;
password: string;
description?: string;
};
export interface TerminalHistory {
id?: number;
connectionId: number;
command: string;
timestamp: number;
output?: string;
exitCode?: number;
duration?: number;
}
export interface SSHConfig {
host: string;
port: number;
username: string;
password: string;
}
export interface TerminalSize {
rows: number;
cols: number;
}
export declare class SSHDatabase {
private db;
private readonly DB_NAME;
private readonly STORE_NAME;
private readonly HISTORY_STORE;
init(): Promise<void>;
getHistory(connectionId: number, limit?: number): Promise<TerminalHistory[]>;
addHistory(history: Omit<TerminalHistory, 'id'>): Promise<number>;
clearHistory(connectionId: number): Promise<void>;
addConnection(connection: SSHConnection): Promise<number>;
getAllConnections(): Promise<SSHConnection[]>;
deleteConnection(id: number): Promise<void>;
updateConnection(connection: SSHConnection): Promise<void>;
}
export declare const sshDB: SSHDatabase;