diff --git a/httpd-client/index.ts b/httpd-client/index.ts index a9ff5a755..2590179e2 100644 --- a/httpd-client/index.ts +++ b/httpd-client/index.ts @@ -13,6 +13,7 @@ import type { CommitHeader, Diff, DiffContent, + DiffFile, HunkLine, } from "./lib/project/commit.js"; import type { Issue, IssueState } from "./lib/project/issue.js"; @@ -46,6 +47,7 @@ export type { CommitHeader, Diff, DiffContent, + DiffFile, DiffResponse, HunkLine, Issue, diff --git a/httpd-client/lib/project/commit.ts b/httpd-client/lib/project/commit.ts index e0dbcc132..ed0043c09 100644 --- a/httpd-client/lib/project/commit.ts +++ b/httpd-client/lib/project/commit.ts @@ -1,5 +1,14 @@ import type { z } from "zod"; -export type { Commits, HunkLine, Commit, Diff, CommitHeader, DiffContent }; +export type { + Commits, + HunkLine, + Hunks, + Commit, + Diff, + CommitHeader, + DiffFile, + DiffContent, +}; import { array, literal, number, object, optional, string, union } from "zod"; export { commitHeaderSchema, diffSchema, commitSchema, commitsSchema }; @@ -36,6 +45,8 @@ const deletionHunkLineSchema = object({ type: literal("deletion"), }); +type DiffFile = z.infer; + const diffFileSchema = object({ oid: string(), mode: union([ @@ -64,6 +75,8 @@ const hunkLineSchema = union([ contextHunkLineSchema, ]); +type Hunks = z.infer; + const changesetHunkSchema = object({ header: string(), lines: array(hunkLineSchema), diff --git a/src/views/projects/Changeset.svelte b/src/views/projects/Changeset.svelte index 39abf3a48..3e29ae8c0 100644 --- a/src/views/projects/Changeset.svelte +++ b/src/views/projects/Changeset.svelte @@ -1,5 +1,11 @@