/**
 * Base types and interfaces for asset management
 */
export interface AssetInfo {
    filename: string;
    size: number;
    contentType: string;
    url: string;
    path: string;
    mediaType: 'image' | 'video' | 'audio' | 'document' | 'other';
}
/**
 * Assets enumerated across the whole backend with their (type, id) origin
 * parsed out of the storage key. Used by the asset manager to avoid
 * per-entity round-trips.
 */
export interface AssetRecord extends AssetInfo {
    entityType: string;
    entityId: string;
}
export interface AssetBackend {
    /**
     * Upload asset to storage
     */
    upload(key: string, buffer: Buffer, contentType: string): Promise<AssetInfo>;
    /**
     * List assets with a given prefix
     */
    list(prefix: string): Promise<AssetInfo[]>;
    /**
     * List every asset under the backend's root, parsed into
     * `{type}/{id}/{filename}` components. Single round-trip for R2 (via
     * paginated ListObjectsV2), single filesystem walk for local. Used by
     * the asset manager to enumerate without per-entity queries.
     */
    listAll(): Promise<AssetRecord[]>;
    /**
     * Server-side copy from one key to another (no download round-trip).
     * Used by the asset re-key migration and cross-repo transfer-copy.
     * Overwrites the destination if it exists (idempotent re-runs).
     */
    copy(srcKey: string, destKey: string): Promise<void>;
    /**
     * Delete a single asset
     */
    delete(key: string): Promise<void>;
    /**
     * Delete all assets with a given prefix
     */
    deleteAll(prefix: string): Promise<number>;
    /**
     * Check if an asset exists
     */
    exists(key: string): Promise<boolean>;
    /**
     * Generate a short-lived pre-signed URL for a stored object.
     * Implemented by remote backends (R2/S3); local backend leaves this
     * undefined since files are streamed directly by the HTTP server.
     * `method` selects the HTTP verb the URL is signed against.
     */
    getSignedUrl?(key: string, expiresIn?: number, method?: 'GET' | 'HEAD'): Promise<string>;
}
export interface AssetConfig {
    storage: 'local' | 'r2';
    localPath?: string;
    r2Config?: R2Config;
}
export interface R2Config {
    accountId: string;
    bucket: string;
    publicUrl: string;
    accessKeyId: string;
    secretAccessKey: string;
}
/**
 * Content type mappings
 */
export declare const CONTENT_TYPES: Record<string, string>;
/**
 * Detect content type from filename
 */
export declare function detectContentType(filename: string): string;
import type { AssetKind } from '../../core/validation.js';
/**
 * Map a filename to the high-level `asset_kind` written into the asset
 * entity's frontmatter. Drives icon and viewer selection; coarser than
 * MIME so the UI doesn't need to enumerate every format. The kind set
 * is canonical in `ASSET_KINDS` in src/core/validation.ts.
 */
export declare function detectAssetKind(filename: string): AssetKind;
/**
 * Extension set the asset upload route accepts. Excludes the structured
 * formats handled elsewhere (.md/.txt → direct write via import-service,
 * .docx → mammoth workstream, .html → bookmark importer).
 */
export declare const ASSET_UPLOAD_EXTENSIONS: Set<string>;
export declare function isAssetUploadExtension(filename: string): boolean;
/**
 * Determine media type from content type
 */
export declare function getMediaType(contentType: string): AssetInfo['mediaType'];
/**
 * Validate filename for security
 */
export declare function validateFilename(filename: string): void;
/**
 * Build asset key from components
 */
export declare function buildAssetKey(entityType: string, entityId: string, filename: string, keyPrefix?: string): string;
/**
 * Build asset prefix for listing
 */
export declare function buildAssetPrefix(entityType: string, entityId: string, keyPrefix?: string): string;
