import { Asset } from './asset'; import { AssetAssociationCollection } from './asset-associations'; import { AssetStore, StoreOptions } from './asset-store'; import { AssetCollection } from './assets'; export type AssetVariantFit = 'cover' | 'contain' | 'inside'; export type AssetCapabilitySource = 'cached' | 'generated' | 'external'; export interface AssetCapabilityRuntime { readonly collection: AssetCollection; readonly associations: AssetAssociationCollection; readonly store: AssetStore; storeDerivedAsset(source: Asset, name: string, data: Buffer, opts: Omit & { role?: string; derivativeMetaType?: string; linkAssociation?: boolean; }): Promise; } export interface AssetVariantRequest { variant: string; width?: number; height?: number; fit?: AssetVariantFit; mimeType?: string; metadata?: Record; } export interface AssetVariantResult { asset: Asset; variant: string; source: AssetCapabilitySource; url?: string | null; metadata?: Record | null; } export interface AssetProcessInput { runtime: AssetCapabilityRuntime; asset: Asset; variants?: AssetVariantRequest[]; metadata?: Record; } export interface AssetProcessResult { asset: Asset; metadata?: Record | null; variants?: AssetVariantResult[]; warnings?: string[]; } export interface AssetEnsureVariantInput { runtime: AssetCapabilityRuntime; asset: Asset; request: AssetVariantRequest; } export interface AssetNearbySearchInput { runtime: AssetCapabilityRuntime; tenantId?: string | null; latitude: number; longitude: number; radiusMeters?: number; limit?: number; source?: string; metadata?: Record; } export interface AssetSearchItem { asset?: Asset | null; assetId: string; origin: string; title?: string | null; previewUrl?: string | null; deliveryUrl?: string | null; mimeType?: string | null; width?: number | null; height?: number | null; distanceMeters?: number | null; metadata?: Record | null; } export interface AssetSearchResult { items: AssetSearchItem[]; nextCursor?: string | null; } export interface AssetExternalSyncInput { runtime: AssetCapabilityRuntime; asset: Asset; externalId?: string | null; sourceRef?: AssetExternalSourceRef | null; metadata?: Record; } export interface AssetExternalSourceRef { system: string; id: string; kind?: string | null; } export interface AssetExternalSyncResult { asset: Asset; provider: string; status: 'ready' | 'pending' | 'skipped'; externalAssetId?: string | null; externalId?: string | null; metadata?: Record | null; } export interface AssetWorkflowInputSelection { slotKey: string; assetIds: string[]; } export interface AssetWorkflowInput { runtime: AssetCapabilityRuntime; asset: Asset; workflowSlug: string; clientRequestId?: string | null; name?: string; inputSelections?: AssetWorkflowInputSelection[]; sourceAssetIds?: string[]; parameters?: Record; requestContext?: Record; requestedPlacement?: string | null; priority?: number | null; } export interface AssetWorkflowResult { provider: string; jobId: string; status: string; idempotent?: boolean; metadata?: Record | null; } export interface AssetCapabilityProvider { readonly name: string; processAsset?(input: AssetProcessInput): Promise; ensureVariant?(input: AssetEnsureVariantInput): Promise; searchNearbyAssets?(input: AssetNearbySearchInput): Promise; syncExternalAsset?(input: AssetExternalSyncInput): Promise; submitAssetWorkflow?(input: AssetWorkflowInput): Promise; } export type AssetCapabilityName = 'processAsset' | 'ensureVariant' | 'searchNearbyAssets' | 'syncExternalAsset' | 'submitAssetWorkflow'; export declare class AssetCapabilityUnavailableError extends Error { readonly capability: AssetCapabilityName; constructor(capability: AssetCapabilityName, message?: string); } export declare class AssetCapabilitySkippedError extends Error { readonly capability: AssetCapabilityName; constructor(capability: AssetCapabilityName, message: string); } //# sourceMappingURL=asset-capabilities.d.ts.map