export type Visibility = "draft" | "internal" | "public";

/** The legal one-step visibility moves from `v`, per the backend state machine
 *  (Draft<->Internal, Internal<->Public; no skipping). */
export function adjacentTransitions(v: Visibility): { forward?: Visibility; back?: Visibility } {
  switch (v) {
    case "draft":
      return { forward: "internal" };
    case "internal":
      return { forward: "public", back: "draft" };
    case "public":
      return { back: "internal" };
  }
}
