import type { Metadata } from '../specs'; import type { ImplementLayer } from './layer'; import type { ImplementService } from './service'; import type { ImplementWidget } from './widget'; /** * 资产包 */ export type AssetPackage = { /** * 资产包版本号 */ version: string; /** * 资产包信息,用于存储资产包元数据信息 */ metadata?: Metadata; /** * 图层资产列表 */ layers: ImplementLayer[]; /** * 组件资产列表 */ widgets: ImplementWidget[]; /** * 服务资产列表 */ services?: ImplementService[]; }; /** * 资产 CDN 包,描述信息 */ export type AssetPackageSpec = { name: string; package: string; version: string; urls: string[]; global: string; /** 描述, * eg: "LI 核心资产, 包含 LI 核心图层、组件、服务" */ description?: string; }; /** * 解析资产 CDN 包配置 */ export type LoadAssetPackageSpecOptions = { /** 是否加载样式资源 */ isLoadStyle?: boolean; /** 是否启用沙箱加载资源 */ sandbox?: boolean | { /** 沙箱注入环境变量 */ injectEnv?: Record; }; };