RTCForge API Reference v1.1.1
    Preparing search index...

    Interface StorageSink

    Random-access destination for received file bytes.

    The receive pipeline writes chunks at their file offsets via StorageSink.write (order-independent), then calls close on success or abort on failure. Built-in implementations include MemorySink, FileSystemAccessSink, and NodeFileSink.

    interface StorageSink {
        abort(reason?: unknown): void | Promise<void>;
        close(): Promise<SinkResult>;
        open?(meta: FileMetadata): void | Promise<void>;
        write(offset: number, data: Uint8Array): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Abandon the transfer and discard any partial output (e.g. free the buffer or delete the partial file).

      Parameters

      • Optionalreason: unknown

        Optional cause of the abort.

      Returns void | Promise<void>

    • Write a chunk at an absolute file offset. Chunks may arrive out of order.

      Parameters

      • offset: number

        Byte offset within the file at which to write.

      • data: Uint8Array

        The chunk bytes.

      Returns Promise<void>