This commit is contained in:
100
src/models/types.ts
Normal file
100
src/models/types.ts
Normal file
@@ -0,0 +1,100 @@
|
||||
export type TerminalType = 'tmux' | 'screen' | 'iterm2' | 'unknown';
|
||||
|
||||
export interface PaneLayout {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface Pane {
|
||||
id: string;
|
||||
index: number;
|
||||
layout: PaneLayout;
|
||||
command?: string;
|
||||
cwd?: string;
|
||||
title?: string;
|
||||
isActive?: boolean;
|
||||
}
|
||||
|
||||
export interface Window {
|
||||
id: string;
|
||||
index: number;
|
||||
name: string;
|
||||
panes: Pane[];
|
||||
layout?: string;
|
||||
activePaneIndex?: number;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
id: string;
|
||||
name: string;
|
||||
windows: Window[];
|
||||
activeWindowIndex: number;
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
export interface Layout {
|
||||
version: string;
|
||||
terminalType: TerminalType;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
session: Session;
|
||||
metadata?: {
|
||||
author?: string;
|
||||
description?: string;
|
||||
tags?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface TemplateVariable {
|
||||
name: string;
|
||||
description: string;
|
||||
defaultValue?: string;
|
||||
required: boolean;
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
name: string;
|
||||
displayName: string;
|
||||
description: string;
|
||||
variables: TemplateVariable[];
|
||||
layout: Layout;
|
||||
}
|
||||
|
||||
export interface UserConfig {
|
||||
layoutDir: string;
|
||||
defaultFormat: 'json' | 'yaml';
|
||||
gitSyncEnabled: boolean;
|
||||
templatesDir: string;
|
||||
}
|
||||
|
||||
export interface GitSyncConfig {
|
||||
enabled: boolean;
|
||||
remoteUrl?: string;
|
||||
branch: string;
|
||||
commitMessage: string;
|
||||
}
|
||||
|
||||
export interface LayoutFile {
|
||||
name: string;
|
||||
path: string;
|
||||
format: 'json' | 'yaml';
|
||||
layout: Layout;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ParserResult<T> {
|
||||
success: boolean;
|
||||
data?: T;
|
||||
error?: string;
|
||||
rawOutput?: string;
|
||||
}
|
||||
|
||||
export interface ExecResult {
|
||||
success: boolean;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
exitCode: number;
|
||||
}
|
||||
Reference in New Issue
Block a user