Skip to content

Type Definitions

Core TypeScript types for Git Unearth API.

Core Types

TypeDescriptionFile
CommitInfoCommit metadata with author, message, hashcommit-info.md
FileBlameLine-level blame result with commit infofile-blame.md
FileDiffUnified diff with hunks and file changesfile-diff.md
RenameHistoryFile rename tracking resultrename-history.md

Usage

typescript
import type {
  CommitInfo,
  FileBlame,
  FileDiff,
  RenameHistory,
} from 'git-unearth'

Type Safety

All types are fully typed with TypeScript 5.9+ strict mode:

  • ✅ No any types
  • ✅ Exhaustive null checks
  • ✅ Explicit return types
  • ✅ Complete JSDoc documentation

Design Principles

  1. Structured Output — All git command outputs are parsed into typed objects
  2. Immutable Data — All types are readonly where applicable
  3. Nullable Explicit — Optional fields explicitly marked with ?
  4. Serializable — All types can be serialized to JSON

MIT License