import type { AssetRecord } from './assets.js'; export interface HarvestedAsset { /** Path inside the theme's `public/`, and the asset's identity. */ path: string; /** Where the bytes came from: a storage-relative path or an absolute URL. */ source: string; bytes: number; } export interface SkippedAsset { value: string; reason: 'external' | 'unreadable' | 'unsafe-path'; } export interface HarvestResult { value: T; assets: AssetRecord[]; harvested: HarvestedAsset[]; skipped: SkippedAsset[]; } /** Reads an image the store owns. Injected so export stays testable offline. */ export type AssetReader = (source: string) => Promise; export interface HarvestOpts { themeDir: string; read: AssetReader; /** * Is this value a file THIS store owns? Default: any root-relative path. * The CLI widens it with the configured storage's own origin, so an S3 store's * absolute URLs are harvested too while foreign hosts are not. */ isStoreOwned?: (value: string) => boolean; } /** * The path an image takes inside the theme. The store's own folder structure is * kept (minus the `/assets/` and `media/` prefixes the URL builder adds), so two * files that lived in different folders cannot collide on their basename. */ export declare function themePathFor(value: string): string | null; /** Does this string look like an image file (rather than a page link or a token)? */ export declare function looksLikeImage(value: string): boolean; /** * Copy every store-owned image in `value` into the theme and replace it with a * token. Returns a new value; the input is untouched. */ export declare function harvestAssets(value: T, opts: HarvestOpts): Promise>;