import { BlobRefMetadata, BlobRef } from '@korajs/core';
import { C as ContentAddressedBlobStore } from './content-addressed-blob-store-CRUU_iCe.js';
/**
* A persistent {@link ContentAddressedBlobStore} backed by the filesystem.
*
* Node-only (exported from `@korajs/store/blob-fs` so it never enters a browser
* bundle). Blobs are stored at `
//`, sharded by hash prefix
* so a single directory never holds millions of entries. Writes are atomic (write
* to a temp file, then rename) so a crash mid-write cannot leave a half-written
* blob under a valid hash. Reads verify the bytes hash to the requested key.
*
* This is the same content-addressed contract as {@link MemoryBlobStore}, so it
* drops into the blob transfer path (chunk staging, blob destination) unchanged.
*/
declare class FilesystemBlobStore implements ContentAddressedBlobStore {
private readonly dir;
readonly durable = true;
/** The directory the bytes live in, for startup logs. */
readonly location: string;
constructor(dir: string);
private pathFor;
put(bytes: Uint8Array, metadata?: BlobRefMetadata): Promise;
get(hash: string): Promise;
has(hash: string): Promise;
delete(hash: string): Promise;
/** When the bytes behind `hash` were last written or uploaded again, in ms, or null when absent. */
lastWrittenAt(hash: string): Promise;
/**
* Deletes `hash` only if it was not written since `cutoffMs`. The file is first moved
* aside, then checked again, so an upload racing the sweep is never lost: a re-upload
* that touched it puts it back, and one that wrote it anew wrote the same bytes.
*/
deleteIfWrittenBefore(hash: string, cutoffMs: number): Promise;
size(): Promise;
list(): Promise;
private exists;
}
export { FilesystemBlobStore };