/** * The keyspace a redis mount is built on, as the ops see it. * * Every op under `core/redis/` reaches redis through this surface and * nothing else, so the transport is the store's business: node speaks RESP * over a socket, the browser speaks the Upstash REST shape over fetch, and * the ops cannot tell which. Paths are mount-relative and values are bytes. * * The key layout is shared by every implementation and by python, so two * runtimes pointed at one server serve one filesystem: `file:` * holds the bytes, `dir` is the set of every directory, * `modified:` the ISO mtime and `attrs:` a hash * carrying the stat overlay. */ export interface RedisRestore { files: Record; dirs: readonly string[]; attrs: Record>; modified: Record; } export interface RedisStoreLike { readonly url: string; readonly keyPrefix: string; /** Connect if the transport needs to, and make sure `/` is a directory. */ open(): Promise; getFile(path: string): Promise; /** A byte window, or null when the file is absent; a null `size` reads to the end. */ getFileRange(path: string, offset: number, size: number | null): Promise; setFile(path: string, data: Uint8Array): Promise; delFile(path: string): Promise; hasFile(path: string): Promise; /** Every file path on the mount sorted by code point, narrowed by `prefix` when given. */ listFiles(prefix?: string): Promise; fileLen(path: string): Promise; hasDir(path: string): Promise; addDir(path: string): Promise; removeDir(path: string): Promise; listDirs(): Promise>; getModified(path: string): Promise; setModified(path: string, ts: string): Promise; delModified(path: string): Promise; getAttrs(path: string): Promise>; setAttrs(path: string, fields: Record): Promise; delAttrs(path: string): Promise; listAttrs(): Promise>>; listModified(): Promise>; /** Drop every key of this mount. */ /** * Write a whole snapshot in as few round trips as the transport allows: * node queues everything into one MULTI, the browser pipelines the side * keys under the REST request cap and sends each file's bytes on its own. */ restore(state: RedisRestore): Promise; clear(): Promise; close(): Promise; } //# sourceMappingURL=store.d.ts.map