import type { UnwrapTagged } from 'type-fest'; import { RESOURCE_TYPE as ApplicationType, type ApplicationRevision, type Application } from './application/index.js'; import { RESOURCE_TYPE as DataSourceType, type DataSourceRevision, type DataSource } from './datasource/index.js'; import { RESOURCE_TYPE as FuncType, type FuncRevision, type Func } from './function/index.js'; import { RESOURCE_TYPE as ModelType, type ModelRevision, type Model } from './model/index.js'; import type { Resource } from './resource.js'; import type { ResourceRevision } from './revision.js'; /** 已知的资源类型 ID */ export type KNOWN_RESOURCE_TYPE_ID = typeof ApplicationType | typeof DataSourceType | typeof FuncType | typeof ModelType; /** 已知的资源类型 */ export declare const KNOWN_RESOURCE_TYPE_ID: Readonly<{ readonly application: import("./resource-id.js").ResourceTypeId<"application">; readonly datasource: import("./resource-id.js").ResourceTypeId<"datasource">; readonly function: import("./resource-id.js").ResourceTypeId<"function">; readonly model: import("./resource-id.js").ResourceTypeId<"model">; }>; /** 已知的资源类型 */ interface KNOWN_RESOURCE_TYPES { /** 应用 */ application: { type: ApplicationType; revision: ApplicationRevision; resource: Application; }; /** 数据源 */ datasource: { type: DataSourceType; revision: DataSourceRevision; resource: DataSource; }; /** 函数 */ function: { type: FuncType; revision: FuncRevision; resource: Func; }; /** 模型 */ model: { type: ModelType; revision: ModelRevision; resource: Model; }; } /** 获取类型数据 */ type KNOWN_RESOURCE_TYPE_DATA = T extends KNOWN_RESOURCE_TYPE_ID ? KNOWN_RESOURCE_TYPES[UnwrapTagged] : T extends UnwrapTagged ? KNOWN_RESOURCE_TYPES[T] : { type: string; revision: ResourceRevision; resource: Resource; }; /** 资源类型 */ export type ResourceOf = KNOWN_RESOURCE_TYPE_DATA['resource']; /** 资源版本类型 */ export type ResourceRevisionOf = KNOWN_RESOURCE_TYPE_DATA['revision']; export {}; //# sourceMappingURL=known-resource-types.d.ts.map