import type { Tagged } from 'type-fest'; import type { ArgumentValue } from '@cloudpss/expression/definitions'; import type { FuncConfiguration, FuncId } from '../function/index.js'; import type { ModelConfiguration, ModelId } from '../model/index.js'; /** 资产 key */ export type AssetKey = Tagged; /** 资产,stage 使用的其他外部资源 */ export interface AssetBase { /** 资产 key */ key: AssetKey; /** 资产类型 */ type: T; } /** 静态资源 */ export interface StaticAsset extends AssetBase<'static'> { /** 资源值的类型 */ valueType?: 'string' | 'number' | 'boolean' | 'record' | 'array'; /** 资源值 */ value: ArgumentValue; } export declare const RunnableAssetStatus: readonly ["waiting", "resolved", "rejected", "aborted", "timed_out"]; /** 运行状态 */ export type RunnableAssetStatus = (typeof RunnableAssetStatus)[number]; /** 函数资源 */ export interface FunctionAsset extends AssetBase<'function'>, FuncConfiguration { /** 函数 */ func: FuncId; /** 自动运行选项 */ autostart: { /** 触发条件 */ on: RunnableAssetStatus[]; /** 延时 [s] */ delay: number; }; } /** 模型资源 */ export interface ModelAsset extends AssetBase<'model'>, Omit { /** 模型 */ model: ModelId; } /** 资产类型映射 */ export interface AssetTypeMap { /** 静态资源 */ static: StaticAsset; /** 函数资源 */ function: FunctionAsset; /** 模型资源 */ model: ModelAsset; } /** 资产类型 */ export type AssetType = keyof AssetTypeMap; /** 资产,stage 使用的其他外部资源 */ export type Asset = AssetTypeMap[AssetType]; //# sourceMappingURL=asset.d.ts.map