Skip to main content

readT8ClientModel

Callable


  • Reads a T8 Client Model from binary data using default factories. This is the main entry point for loading a T8 Client Model.

    @throws

    If the data format is invalid or corrupted

    @example
    const arrayBuffer = await fetch('model.t8cm').then(r => r.arrayBuffer());
    const model = readT8ClientModel(arrayBuffer);
    console.log(model.products.length);
    console.log(model.entityTypes.length);

    Parameters

    • data: ArrayBufferLike | ArrayBufferLike[]

      ArrayBuffer or SharedArrayBuffer containing the binary T8 Client Model data

    Returns T8ClientModel<T8Project, T8Product<T8EntityType>, T8EntityType, T8Unit>

    Complete T8 Client Model with all products, entity types, units, and relationships