import type { WorkItem, WorkType } from './schema.ts';
/** Label applied to every GitHub issue created by `xy work`. */
export declare const XY_WORK_GITHUB_LABEL = "xy-work";
/** HTML comment marker embedded in issue bodies so we can recognize our issues. */
export declare const XY_WORK_GITHUB_BODY_MARKER_PREFIX = "<!-- xy-work:";
export interface GithubIssueRef {
    number: number;
    url: string;
}
export interface GithubIssueSnapshot {
    body: string;
    createdAt: string;
    labels: string[];
    number: number;
    state: 'OPEN' | 'CLOSED' | string;
    title: string;
    updatedAt: string;
    url: string;
}
export interface GithubWorkStoreData {
    createdByXyWork: true;
    number: number;
    url: string;
}
export interface GithubWorkRunnerResult {
    status: number | null;
    stderr: string;
    stdout: string;
}
export type GithubWorkRunner = (args: readonly string[], options?: {
    cwd?: string;
}) => GithubWorkRunnerResult;
export type GithubIssueListState = 'open' | 'closed' | 'all';
export interface GithubIssueUpdate {
    body?: string;
    state?: 'open' | 'closed';
    title?: string;
}
export interface GithubWorkBridge {
    createIssue: (cwd: string, item: WorkItem) => GithubIssueRef;
    isAvailable: (cwd: string) => boolean;
    listIssues: (cwd: string, state?: GithubIssueListState) => GithubIssueSnapshot[];
    listOpenIssues: (cwd: string) => GithubIssueSnapshot[];
    updateIssue: (cwd: string, issueNumber: number, update: GithubIssueUpdate) => void;
}
export declare const formatXyWorkBodyMarker: (id: string) => string;
export declare const isXyWorkGithubIssue: (issue: Pick<GithubIssueSnapshot, "body" | "labels">) => boolean;
/** Extract the local work id embedded in a GitHub issue body created by `xy work`. */
export declare const parseXyWorkIdFromGithubBody: (body: string) => string | undefined;
export declare const githubIssueIsOpen: (issue: Pick<GithubIssueSnapshot, "state">) => boolean;
export declare const readGithubStoreNumber: (stores: Record<string, unknown>) => number | undefined;
export declare const readGithubStoreUrl: (stores: Record<string, unknown>) => string | undefined;
export declare const formatGithubWorkIssueBody: (item: WorkItem) => string;
export declare const inferWorkTypeFromGithubLabels: (labels: readonly string[]) => WorkType;
export declare const githubWorkItemId: (issueNumber: number) => string;
export declare const normalizeGithubIssueToWorkItem: (issue: GithubIssueSnapshot) => WorkItem;
export declare const parseGithubWorkStore: (stores: Record<string, unknown>) => GithubWorkStoreData | undefined;
export declare const createGithubWorkBridge: (runner?: GithubWorkRunner) => GithubWorkBridge;
export declare const defaultGithubWorkBridge: GithubWorkBridge;
//# sourceMappingURL=github.d.ts.map