Interface SiteModelRepositoryInterface

Site model data repository.

The site model repository object enables standard create, read, update, and delete methods on site model entities. Additional helpful methods are provided that enable more advanced retrieval of site model entities.

interface SiteModelRepositoryInterface {
    create(): SiteModelEntityInterface;
    filter(params): Promise<SiteModelEntityInterface[]>;
    findAll(forceFetch?): Promise<SiteModelEntityInterface[]>;
    findByTypeAndDistance2D(type, pos, maxDist): Promise<SiteModelEntityInterface[]>;
    findClosestByTypeAndDistance2D(type, pos, maxDist): Promise<SiteModelEntityInterface>;
    findOne(id, forceFetch?): Promise<SiteModelEntityInterface>;
    findWithin(localLocation, entityType?): Promise<SiteModelEntityInterface[]>;
    generate(): Promise<SiteModelEntityInterface[]>;
    remove(item): Promise<void>;
    save(objects): Promise<SiteModelEntityInterface[]>;
    updateAttributes(objects): Promise<SiteModelEntityInterface[]>;
}

Hierarchy (view full)

Methods

  • Gets all repository items. The cached data will be returned if the data has been fetched before. Using the forceFetch parameter, a user can order a fresh copy to be fetched from the server.

    Parameters

    • Optional forceFetch: boolean

      Whether to bypass the cache and retrieve a fresh copy from the server.

    Returns Promise<SiteModelEntityInterface[]>

    Promise with the repository items.

  • Get one repository item by id. The cached data will be returned if the data has been fetched before. Use the forceFetch parameter to retrieve a fresh copy from the server. In case a new record is fetched, the data and dataMap will be updated accordingly.

    Parameters

    • id: number

      Identifier of the repository item

    • Optional forceFetch: boolean

      Whether to bypass the cache and retrieve a fresh copy from the server.

    Returns Promise<SiteModelEntityInterface>

  • Find site model entities from a given local coordinate with optional site model type.

    Parameters

    • localLocation: Vector2 | Vector3

      Local point from which to find nearby site model entities.

    • Optional entityType: SiteModelType

      Reduce search to include only the given site model type.

    Returns Promise<SiteModelEntityInterface[]>

Generated using TypeDoc