File
Blob: src/worker/git/object-store/types.ts
| 1 | import type { GitObjectType } from "@/worker/git/core"; |
| 2 | export type { PackCatalogRow } from "@/worker/do/repo/db/schema"; |
| 3 | |
| 4 | export type PackedObjectLocation = { |
| 5 | packKey: string; |
| 6 | objectIndex: number; |
| 7 | offset: number; |
| 8 | nextOffset: number; |
| 9 | }; |
| 10 | |
| 11 | export type PackedObjectResult = PackedObjectLocation & { |
| 12 | oid: string; |
| 13 | type: GitObjectType; |
| 14 | payload: Uint8Array; |
| 15 | }; |
| 16 | |
| 17 | export type PackedObjectReadResult = PackedObjectResult | undefined; |
| 18 | |
| 19 | export type IdxView = { |
| 20 | packKey: string; |
| 21 | count: number; |
| 22 | fanout: Uint32Array; |
| 23 | rawNames: Uint8Array; |
| 24 | offsets: Float64Array; |
| 25 | /** Start of the next pack entry for each object index; last entry points at the pack trailer. */ |
| 26 | nextOffsetByIndex: Float64Array; |
| 27 | /** Pack offsets sorted ascending, paired with sortedOffsetIndices for binary search. */ |
| 28 | sortedOffsets: Float64Array; |
| 29 | /** Entry indices corresponding to each element of sortedOffsets. */ |
| 30 | sortedOffsetIndices: Uint32Array; |
| 31 | packSize: number; |
| 32 | /** Pack checksum copied from the `.idx` trailer. */ |
| 33 | packChecksum: Uint8Array; |
| 34 | /** Checksum of the `.idx` contents before its final checksum field. */ |
| 35 | idxChecksum: Uint8Array; |
| 36 | }; |