All files / src/lib/dev-tools types.ts

0% Statements 0/123
100% Branches 0/0
0% Functions 0/1
0% Lines 0/123

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124                                                                                                                                                                                                                                                       
/**
 * Type definitions for Dev Tools
 */

// Command Runner Types
export interface CommandResult {
  success: boolean;
  output: string;
  error: string;
  exitCode: number;
  duration: number;
}

// Test Runner Types
export interface TestSuiteStats {
  passed: number;
  failed: number;
  total: number;
}

export interface TestFailure {
  testName: string;
  suiteName: string;
  message: string;
  stack?: string;
}

export interface TestResult {
  testSuites: TestSuiteStats;
  tests: TestSuiteStats;
  snapshots?: TestSuiteStats;
  failures: TestFailure[];
  duration: number;
  success: boolean;
}

// ESLint Types
export interface LintMessage {
  line: number;
  column: number;
  severity: 1 | 2; // 1 = warning, 2 = error
  message: string;
  ruleId: string | null;
}

export interface LintFileResult {
  filePath: string;
  messages: LintMessage[];
  errorCount: number;
  warningCount: number;
}

export interface LintResult {
  errorCount: number;
  warningCount: number;
  fixableErrorCount: number;
  fixableWarningCount: number;
  files: LintFileResult[];
  success: boolean;
}

// TypeScript Types
export interface TypeScriptError {
  file: string;
  line: number;
  column: number;
  code: string;
  message: string;
}

export interface TypeScriptResult {
  errorCount: number;
  errors: TypeScriptError[];
  success: boolean;
}

// Markdown Document Types
export interface MarkdownHeading {
  level: number;
  text: string;
  id: string;
}

export interface MarkdownDocument {
  title: string;
  filename: string;
  content: string;
  headings: MarkdownHeading[];
  modifiedAt: string;
}

export interface PlanSummary {
  slug: string;
  title: string;
  filename: string;
  status: 'active' | 'archived';
  priority?: string;
  complexity?: string;
  modifiedAt: string;
}

export interface GuideSummary {
  slug: string;
  title: string;
  filename: string;
  description?: string;
  modifiedAt: string;
}

// API Response Types
export interface DevToolsApiResponse<T = unknown> {
  success: boolean;
  data?: T;
  error?: string;
}

export interface CommandStatusResponse {
  status: 'idle' | 'running' | 'completed' | 'failed';
  output?: string;
  result?: TestResult | LintResult | TypeScriptResult;
  startedAt?: string;
  completedAt?: string;
}