/*! * Copyright (c) 2026 Interop Alliance. All rights reserved. */ /** * The WAS binding of `@interop/vh-resource-log`'s store port: the log is a * WAS Resource's entire body, stored as `text/jsonl`, with the port's * read-with-etag, compare-and-swap append, and guarded genesis create mapped * onto the resource's conditional writes. The hosting collection may be * plaintext or encrypted: a conditional codec pins the write to the `ifMatch` * this store passes rather than to the ETag its own pre-read observed, so the * append profile's compare-and-swap holds either way. On an encrypted host * the resource id must be one the codec mints, since the EDV codec refuses to * create a document under a human-readable id. * * Both the append and the create ride the backend's `conditional-writes` * feature -- the profile requires it (without the precondition, concurrent * appends silently overwrite one another instead of failing into the caller's * rebase-and-retry loop). A lost race -- a stale `ifMatch`, or a guarded * create against a log that already exists -- is rethrown as the library's * `ResourceLogConflictError` with the transport's `PreconditionFailedError` * as `cause`, which is the port's one conflict signal and what the library's * rebase loop catches (by `name`, never `instanceof` -- the error crosses the * adapter-to-library package boundary). */ import { type ResourceLogStore } from '@interop/vh-resource-log'; import type { Resource } from '../Resource.js'; /** * The content type a resource log is stored under (JSON Lines, not JSON -- * load-bearing: a JSON content type would have the request layer parse and * re-serialize the body, losing the line framing). */ export declare const LOG_CONTENT_TYPE = "text/jsonl"; /** * The WAS Resource adapter implementing the library's `ResourceLogStore` * port. `read` keeps the Blob / text body handling (a React Native Blob has * no `text()`; `blobText` falls back to `FileReader`), `append` carries the * prior entries' bytes forward verbatim from the most recent read (an append * never re-serializes history), and both `append` and `create` translate the * transport's 412 into the library's conflict error. * * @param options {object} * @param options.resource {Resource} * @returns {ResourceLogStore} */ export declare function resourceLogStore({ resource }: { resource: Resource; }): ResourceLogStore; //# sourceMappingURL=logStore.d.ts.map