tarlatan
    Preparing search index...

    Interface StateFiles

    Reads and publishes state files. Program receives stateFiles; a test may inject another.

    interface StateFiles {
        publish: (
            path: string,
            bytes: Uint8Array,
        ) => Effect<string & Brand<"Sha256">, StateFileFailed>;
        read: (
            path: string,
        ) => Effect<Uint8Array<ArrayBufferLike>, StateFileFailed>;
        readIfPresent: (
            path: string,
        ) => Effect<Option<Uint8Array<ArrayBufferLike>>, StateFileFailed>;
    }
    Index
    publish: (
        path: string,
        bytes: Uint8Array,
    ) => Effect<string & Brand<"Sha256">, StateFileFailed>

    Publishes bytes atomically at path (see the module comment) and returns their SHA-256 as 64 lower-case hexadecimal digits. On failure the final name is left as it was, unless the failure came after the rename, while flushing the directory.

    read: (path: string) => Effect<Uint8Array<ArrayBufferLike>, StateFileFailed>

    Reads the whole file at path as bytes.

    readIfPresent: (
        path: string,
    ) => Effect<Option<Uint8Array<ArrayBufferLike>>, StateFileFailed>

    Reads the whole file at path, or none when no file is there (review item M02). Only a missing file is none; a file that is present but cannot be read, such as a directory or one without permission, fails.