API

Interface I3mfSerializer<T>

Minimal contract for a 3MF serializer that can stream its output through a sink callback.

The sink callback receives:

  • err: any error produced by the serialization pipeline (if any)
  • chunk: a chunk of bytes to append to the destination
  • final: true when this is the last chunk

Important:

  • Implementations should call sink with final=true exactly once, or rely on the underlying zip lib to do so.
  • Consumers may ignore final if they just buffer everything.
interface I3mfSerializer<T> {
    serializeAsync(
        sink: (err: any, chunk: Uint8Array, final: boolean) => void,
        ...meshes: T[],
    ): Promise<void>;
}

Type Parameters

  • T

Implemented by

Index