Type Definitions
Core TypeScript types for Git Unearth API.
Core Types
| Type | Description | File |
|---|---|---|
CommitInfo | Commit metadata with author, message, hash | commit-info.md |
FileBlame | Line-level blame result with commit info | file-blame.md |
FileDiff | Unified diff with hunks and file changes | file-diff.md |
RenameHistory | File rename tracking result | rename-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
anytypes - ✅ Exhaustive null checks
- ✅ Explicit return types
- ✅ Complete JSDoc documentation
Design Principles
- Structured Output — All git command outputs are parsed into typed objects
- Immutable Data — All types are readonly where applicable
- Nullable Explicit — Optional fields explicitly marked with
? - Serializable — All types can be serialized to JSON
Related
- API Functions — Function signatures using these types
- Caching Guide — Cache-related types