Abstract I/O service.

The most common use of the I/O service is to read/write a Document with a given path. Methods are also available for converting in-memory representations of raw glTF files, both binary (Uint8Array) and JSON (JSONDocument).

For platform-specific implementations, see NodeIO, WebIO, and DenoIO.




  • Creates a shallow copy of glTF-formatted JSONDocument.

    Images, Buffers, and Resources objects are deep copies so that PlatformIO can safely modify them during the parsing process. Other properties are shallow copies, and buffers are passed by reference.

  • readBinary(glb: Uint8Array): Promise<Document>
  • readURI(uri: string, type: "view"): Promise<Uint8Array>
  • readURI(uri: string, type: "text"): Promise<string>
  • readURI(uri: string, type: "view" | "text"): Promise<string | Uint8Array>
  • registerDependencies(dependencies: {}): PlatformIO
  • writeBinary(doc: Document): Promise<Uint8Array>
  • writeJSON(doc: Document, _options?: Partial<Pick<WriterOptions, "format" | "basename">>): Promise<JSONDocument>
Function symbol, f(📦) → 📦, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy TypeDoc documentation Copyright 2023, MIT license