import { type Block, type CollectionSchema } from "@contfu/core"; import { type DbCtx } from "../../infra/db/db.js"; import type { MediaConvertOpts, MediaOptimizer, TransformMediaRule } from "../../domain/media.js"; import type { FileStore } from "../../domain/files.js"; /** * Check whether an extension is allowed by a rule's include/exclude filter. */ export declare function isExtensionAllowed(ext: string, rule: TransformMediaRule): boolean; export type FileLinkParts = { stableUrl: string; leaseUrl?: string; expiresAt?: number; }; /** * Extract ImageBlocks from content, create pending file rows, and enqueue async * download/processing work. * Returns the content array with ImageBlock URLs replaced by file ids. */ export declare function processFilesSync(opts: { itemId: number; content: Block[]; fileStore: FileStore; mediaOptimizer?: MediaOptimizer; transformMedia?: TransformMediaRule[]; collection: string; pregenerate?: MediaConvertOpts[]; /** Collects every file id the item references, so callers can prune the rest. */ linked?: Set; ctx?: DbCtx; }): Block[]; /** * Process media URLs in item properties (FILE/FILES typed props). * Creates pending file rows and replaces URLs with file ids. * Returns a shallow clone of props with processed values. */ export declare function processPropertyFilesSync(opts: { itemId: number; props: Record; schema: CollectionSchema; fileStore: FileStore; mediaOptimizer?: MediaOptimizer; transformMedia?: TransformMediaRule[]; collection: string; pregenerate?: MediaConvertOpts[]; /** Collects every file id the item references, so callers can prune the rest. */ linked?: Set; ctx?: DbCtx; }): Record; /** * Async compatibility wrapper for callers that process files outside a database * transaction. Database preparation itself remains synchronous so it can be * composed into the atomic sync-event transaction. */ export declare function processFiles(opts: Parameters[0]): Promise; /** Async compatibility wrapper for property-file processing callers. */ export declare function processPropertyFiles(opts: Parameters[0]): Promise>; export declare function extFromUrl(url: string): string | undefined;