import type { ConfigField, GitHubRepo, WidgetRenderOut, WidgetStats } from '../../lib/contract/types'; /** * dsh-widgets — GitHub family shared view helpers (contract-stable core). * * Five units (`github-contrib` / `github-stars` / `github-issues` / * `github-push` / `github-board`) read ONE host payload (`/api/github`, see * `src/index.ts`) and share everything about how it becomes a card: the two * config fields, which repo a pulse card is about, the tap-cycle across * several repos, and the degraded card for every way the payload can be thin. * A unit therefore holds only its own descriptor + dictionary. * * The family is deliberately split rather than merged into one 2×2 tile: * these are four independent readings (how much you contributed, how many * stars, whether anyone is waiting on you, when it last moved), and the card * grammar gives ONE dominant figure per 150px tile. `github-board` is the 2×4 * that puts them side by side for the wide-slot case. */ /** The fields every GitHub card shares. Both are OPTIONAL on purpose: empty * means "whatever this machine is signed in as" (the host resolves the login * from the credential / `gh` CLI), so a fresh install shows the user's own * numbers with nothing typed. */ export declare function githubConfigSchema(): ConfigField[]; /** `Physicolor/dsh-widgets` -> `dsh-widgets` (the card has 150px, the owner * usually does not disambiguate anything). */ export declare function repoShort(fullName: string): string; /** The repo a pulse card reads: the family's shared selection (`ghRepo`, * written by any card's tap-cycle and persisted per instance) or the first * repo the host answered with. */ export declare function selectedRepo(stats: WidgetStats): GitHubRepo | null; /** Tap-to-cycle across the answered repos. Every repo card carries the SAME * modes + store, so tapping any one of them moves the whole family — the * usage/cc pool family's behaviour, for the same reason (several cards, one * subject). Absent with a single repo: nothing to switch to, so no gesture. */ export declare function repoCycle(stats: WidgetStats): WidgetRenderOut['cycle']; /** Why a GitHub card has nothing to show. Reads the SHELL-facing error first * (the route itself never answered) and falls back to what the payload said * about its own slices, so "restart dsh web" is never confused with "you are * not signed in". */ export declare function emptyHint(stats: WidgetStats, slice: 'contributions' | 'repos'): string; /** Widget-owned preview payload: what the market / 组件配置 surfaces feed the * family so every card renders its real shape with no network call and no * credentials (the units' `example.stats`). */ export declare function githubPreviewStats(): Partial;