Namespace io

xeokit File I/O


File loading primitive shared by every SDK loader.


The io module abstracts the "go fetch a file" step so loader code calls a single FileIO interface and stays portable. The shipped implementation is BrowserFileIO, which fetches over HTTP(S) and returns a Blob. A Node implementation hasn't been ported yet.


  • One interfaceFileIO is the contract every loader codes against. Hosts that need a different transport (a CDN sidecar, an in-memory test fixture) supply their own implementation.
  • CrossPlatformBlob — uniform Blob-like with arrayBuffer() / text() / json().

npm install @xeokit/sdk

import { BrowserFileIO } from "@xeokit/sdk/base/io";

const io = new BrowserFileIO();
const buffer = await io.load("./model.xgf");
// pass `buffer` to an XGFLoader.load(...)

Classes

BrowserFileIO

Interfaces

FileIO

Type Aliases

CrossPlatformBlob