UNPKG

digitaltwin-core

Version:

Minimalist framework to collect and handle data in a Digital Twin project

63 lines 1.96 kB
import { Handler } from './handler.js'; import type { ComponentConfiguration, DataResponse } from './types.js'; import type { AssetsManager } from './assets_manager.js'; /** * Global assets handler that provides access to ALL assets across ALL asset managers. * * This handler aggregates assets from all registered AssetsManager instances * without duplicating their logic or hardcoding component names. * * @class GlobalAssetsHandler * @extends {Handler} * * @example * ```typescript * const globalHandler = new GlobalAssetsHandler() * globalHandler.setAssetsManagers([gltfManager, pointcloudManager]) * * // Usage: * // GET /assets/all - Returns all assets from all managers * ``` */ export declare class GlobalAssetsHandler extends Handler { private assetsManagers; /** * Inject AssetsManager dependencies (called by engine) */ setAssetsManagers(assetsManagers: AssetsManager[]): void; /** * Component configuration for the global assets handler */ getConfiguration(): ComponentConfiguration; /** * Get all assets from all registered asset managers. * * This method delegates to each AssetsManager's getAllAssets() method * and aggregates the results with proper endpoint URLs. * * @returns {Promise<DataResponse>} JSON response with all assets * * @example * ```typescript * // GET /assets/all * // Returns: { * // total: 5, * // assets: [ * // { id: 1, component: "gltf", url: "/gltf/1", ... }, * // { id: 2, component: "pointcloud", url: "/pointcloud/2", ... } * // ] * // } * ``` */ getAllAssets(): Promise<DataResponse>; /** * HTTP endpoints for global assets */ getEndpoints(): Array<{ method: any; path: string; handler: (...args: any[]) => any; responseType?: string; }>; } //# sourceMappingURL=global_assets_handler.d.ts.map