import type { DependencyEdge, GiteaIssue, GiteaMilestone } from '@commitea/core'

/** The gitea bridge exposed by the preload over IPC (main-process backed). */
export interface GiteaBridge {
  status(): Promise<{ configured: boolean; repo: string | null }>
  reconcile(): Promise<{
    configured: boolean
    issues: GiteaIssue[]
    milestones: GiteaMilestone[]
    deps: DependencyEdge[]
  }>
  getIssue(index: number): Promise<GiteaIssue | null>
}

declare global {
  interface Window {
    commitea: {
      platform: string
      gitea: GiteaBridge
    }
  }
}
