import type { ResizeRule } from "@paroicms/public-anywhere-lib"; import type { ImageVariantWithBinary, UsedRawSize } from "../engine-types.js"; import type { VariantEngineContext } from "./engine-context.js"; import type { ResizeOwner, StoredCacheItem } from "./internal.types.js"; export declare function insertIntoImageVariant(ctx: Pick, data: { resourceVersion: string; mediaId: string; mediaType: string; rawWidth: number; rawHeight: number; weightB: number; binaryFile: Buffer; slug?: string; }, owners: ResizeOwner[]): Promise<{ imageCacheId: string; lastModified: string; }>; export declare function insertIntoPaImageCacheOwner(ctx: Pick, input: { imageCacheId: string; owners: ResizeOwner[]; }): Promise; export declare function fetchImageVariantWithBinary(ctx: Pick, input: { mediaId: string; mediaType: string; rawWidth: number; rawHeight: number; }): Promise<{ variant: ImageVariantWithBinary; id: string; } | undefined>; export declare function fetchImageVariantWithBinaryByOwner(ctx: Pick, input: { mediaId: string; mediaType: string; ownerHandle: string; rawResizeR: ResizeRule; }): Promise<{ variant: ImageVariantWithBinary; id: string; } | undefined>; export declare function deleteVariants(ctx: VariantEngineContext, options: { mediaId: string; } | { mediaIds: string[]; }): Promise; /** * @returns the list of cache ownerHandles that were deleted */ export declare function deleteVariantsByDependencies(ctx: VariantEngineContext, options: { ownerHandles: string[]; }): Promise; /** * Delete the images that have no ownerHandle and that have not been used recently. * @returns the number of cache identifiers that were deleted */ export declare function deleteOrphanVariants(ctx: VariantEngineContext): Promise; export declare function associateOwnerToImages(ctx: Pick, { ownerHandle, cacheImages, isHandleReusable, }: { ownerHandle: string; cacheImages: { imageCacheId: string; rawResizeR: ResizeRule; }[]; isHandleReusable: boolean; }): Promise; export declare function fetchStoredCacheItems(ctx: Pick, ownerHandle: string): Promise; export declare function fetchBatchOfStoredCacheItems(ctx: Pick, groups: { requestedVariants: { mediaType: string; rawWidth: number; rawHeight: number; }[]; mediaIds: string[]; }[], alreadyOwnedBy: string): Promise; export declare function clearAll({ cn, logger }: VariantEngineContext): Promise; export declare function makeMTypeRSizeKey(image: { mediaType: string; rawWidth: number; rawHeight: number; }): string; export declare function fetchUsedRawSizesByMedia(ctx: Pick, mediaId: string): Promise; /** * DEBUG: Log when images become orphaned (no owners left). * Call this before deleting orphan variants to see what's being cleaned up. */ export declare function debugLogOrphanedImages(ctx: Pick): Promise; //# sourceMappingURL=queries.d.ts.map