Search Docs
Loading...
Skip to content

Interface: AssetsQuery

Query for searching assets. Field shape mirrors @cesdk/engine’s AssetQueryData so a single query object is interchangeable across bindings. page and perPage are required by WASM but kept optional here so simpler callers (e.g., native shared tests) can omit them; the binding layers fall back to defaults.

Properties#

Property Type Description
query? string A query string used for (fuzzy) searching of labels and tags
page? number The current page queried for paginated views.
perPage? number The number of results queried. How many assets shall be returned regardless of the total number of assets available. Together with page this can be used for pagination.
groups? AssetGroups Query only these groups
tags? string string[]
locale? string The locale of the labels and tags for localized search and filtering. Local asset sources and the built-in sources ly.img.animations, ly.img.transitions and ly.img.scene.colors resolve labels and tags with a fallback chain: requested locale → “en” → first available entry → empty default.
excludeGroups? AssetGroups Filter out assets with this groups
sortKey? string The key that identifies the meta data value to sort by or ‘id’ to sort by the asset ID. If empty, the assets are sorted by the index.
sortingOrder? string The order to sort by if the asset source supports sorting. If set to None, the order is the same as the assets were added to the source.
sortActiveFirst? boolean Sort assets that are marked as active first.
filter? AssetFilter[] Structured filter, AND-combined with query / tags / groups / excludeGroups. The top-level array is an implicit AND of its entries. Prefer filter over the legacy tags / groups / excludeGroups fields for anything beyond a plain case-sensitive include/exclude list (substring matches, meta.<key>, or / not combinators).
facets? AssetFacetPath[] Facet distributions to compute over the matched (pre-pagination) set, e.g. to populate filter dropdowns. Local sources compute facets automatically; custom sources may fulfill any subset of the request. Combine with perPage: 0 to enumerate values without fetching assets.