# Class T8ClientModel<TProject, TProduct, TEntityType, TUnit>

Main container class for a T8 Client Model. Contains all building elements (products), entity types, units, and their relationships.

#### Example

    const buffer = await fetch('model.t8cm').then(r => r.arrayBuffer());
    const model = readT8ClientModel(buffer);
    console.log(`Loaded ${model.products.length} products`);
    console.log(`Model has ${model.entityTypes.length} entity types`);

#### Type Parameters

- TProject = T8Project

  The project type (default: T8Project)

- TProduct = T8Product

  The product type (default: T8Product)

- TEntityType = T8EntityType

  The entity type (default: T8EntityType)

- TUnit = T8Unit

  The unit type (default: T8Unit)

##### Index

### Constructors

constructor

### Properties

computedPropertySetRepository
entityTypes
products
project
propertySetRepository
quantitySetRepository
units

## Constructors

### constructor

- new T8ClientModel<
  TProject = T8Project<T8Product<T8EntityType<T8Unit>, T8Unit>, T8Unit>,
  TProduct = T8Product<T8EntityType<T8Unit>, T8Unit>,
  TEntityType = T8EntityType<T8Unit>,
  TUnit = T8Unit,
  >(
  project: TProject,
  products: TProduct[],
  entityTypes: TEntityType[],
  units: TUnit[],
  propertySetRepository: T8PropertySetRepository<TUnit>,
  computedPropertySetRepository: T8PropertySetRepository<TUnit>,
  quantitySetRepository: T8QuantitySetRepository<TUnit>,
  ): T8ClientModel<TProject, TProduct, TEntityType, TUnit>

  #### Type Parameters

  - TProject = T8Project<T8Product<T8EntityType<T8Unit>, T8Unit>, T8Unit>
  - TProduct = T8Product<T8EntityType<T8Unit>, T8Unit>
  - TEntityType = T8EntityType<T8Unit>
  - TUnit = T8Unit

  #### Parameters

  - project: TProject

    The project information

  - products: TProduct[]

    Array of all products (building elements) in the model

  - entityTypes: TEntityType[]

    Array of all entity types (e.g. types of walls) defined in the model

  - units: TUnit[]

    Array of all units of measurement used in the model

  - propertySetRepository: T8PropertySetRepository<TUnit>

    Repository for accessing property sets

  - computedPropertySetRepository: T8PropertySetRepository<TUnit>

    Repository for accessing computed property sets

  - quantitySetRepository: T8QuantitySetRepository<TUnit>

    Repository for accessing quantity sets

  #### Returns T8ClientModel<TProject, TProduct, TEntityType, TUnit>

## Properties

### computedPropertySetRepository

computedPropertySetRepository: T8PropertySetRepository<TUnit>

Repository for accessing computed property sets

### entityTypes

entityTypes: TEntityType[]

Array of all entity types (e.g. types of walls) defined in the model

### products

products: TProduct[]

Array of all products (building elements) in the model

### project

project: TProject

The project information

### propertySetRepository

propertySetRepository: T8PropertySetRepository<TUnit>

Repository for accessing property sets

### quantitySetRepository

quantitySetRepository: T8QuantitySetRepository<TUnit>

Repository for accessing quantity sets

### units

units: TUnit[]

Array of all units of measurement used in the model