Skip to main content

ItemsFinder

Manages and executes queries to find items within models based on specified criteria. This class provides functionalities to create, store, and execute FinderQuery instances, allowing for efficient retrieval of items that match given query parameters. 📕 Tutorial. 📘 API.

Extends​

Implements​

Properties​

enabled​

enabled: boolean = true

Component.enabled

Overrides​

Component . enabled


list​

readonly list: DataMap<string, FinderQuery>

A map of FinderQuery objects, indexed by a string key.


uuid​

static readonly uuid: "0da7ad77-f734-42ca-942f-a074adfd1e3a"

A unique identifier for the component. This UUID is used to register the component within the Components system.

Methods​

addFromCategories()​

addFromCategories(modelIds?): Promise<string[]>

Adds queries based on categories from items that have geometry.

Parameters​

ParameterTypeDescription
modelIds?RegExp[]An optional array of model IDs to filter fragments. If not provided, all fragments are processed.

Returns​

Promise<string[]>

An array with the categories used to create the queries


create()​

create(name, queries): FinderQuery

Creates a new FinderQuery instance and adds it to the list of queries.

Parameters​

ParameterTypeDescription
namestringThe name of the query.
queriesItemsQueryParams[]The queries to use.

Returns​

FinderQuery

The newly created FinderQuery instance.


export()​

export(): object

Serializes the ItemsFinder's data into a format suitable for export.

Returns​

object

An object containing an array of serialized finder queries.

data​

data: SerializedFinderQuery[]

Implementation of​

Serializable.export


getItems()​

getItems(queries, config?): Promise <ModelIdMap>

Retrieves items from specified models based on a query.

Parameters​

ParameterTypeDescription
queriesItemsQueryParams[]The query parameters to filter items.
config?object-
config.aggregation?QueryResultAggregation-
config.items?ModelIdMap-
config.modelIds?RegExp[]-

Returns​

Promise <ModelIdMap>

A map of model IDs to sets of item IDs that match the query.


import()​

import(result): FinderQuery[]

Imports a list of FinderQuery instances from a SerializationResult containing serialized finder query data.

Parameters​

ParameterTypeDescription
resultSerializationResult <SerializedFinderQuery, Record<string, any>>The SerializationResult containing the serialized SerializedFinderQuery data.

Returns​

FinderQuery[]

An array of FinderQuery instances created from the serialized data. Returns an empty array if the input data is null or undefined.

Implementation of​

Serializable.import


isConfigurable()​

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns​

this is Configurable<any, any>

Inherited from​

Component . isConfigurable


isDisposeable()​

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns​

this is Disposable

Inherited from​

Component . isDisposeable


isHideable()​

isHideable(): this is Hideable

Whether is component is Hideable.

Returns​

this is Hideable

Inherited from​

Component . isHideable


isResizeable()​

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns​

this is Resizeable

Inherited from​

Component . isResizeable


isSerializable()​

isSerializable(): this is Serializable<any, Record<string, any>>

Whether is component is Serializable.

Returns​

this is Serializable<any, Record<string, any>>

Inherited from​

Component . isSerializable


isUpdateable()​

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns​

this is Updateable

Inherited from​

Component . isUpdateable