starling-devex 0.1.2

Starling: a local dev orchestrator with a central daemon, shared named-URL proxy, and a k9s-style TUI (a Rust port of Tilt + portless)
import type { UIResourceStateWaiting } from "./core"

export class Hold {
  reason: string
  count: number = 0
  resources: string[] = []
  images: string[] = []
  clusters: string[] = []

  constructor(waiting: UIResourceStateWaiting) {
    this.reason = waiting.reason ?? ""
    for (const ref of waiting.on ?? []) {
      this.count++
      if (ref.kind === "UIResource" && ref.name) {
        this.resources.push(ref.name)
      }
      if (ref.kind === "ImageMap" && ref.name) {
        this.images.push(ref.name)
      }
      if (ref.kind === "Cluster" && ref.name) {
        this.clusters.push(ref.name)
      }
    }
  }
}