Init indexed file
This commit is contained in:
16
lib/dat/types.ts
Normal file
16
lib/dat/types.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// src/data-file/types.ts
|
||||
export interface Serializer<T> {
|
||||
serialize(data: T): Buffer;
|
||||
deserialize(buf: Buffer): T;
|
||||
}
|
||||
|
||||
export interface DataEntry<T> {
|
||||
sequence: number;
|
||||
timestamp: bigint;
|
||||
data: T;
|
||||
}
|
||||
|
||||
export interface DataFileOptions<T> {
|
||||
serializer: Serializer<T>;
|
||||
maxEntries?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user