//#region src/assets/copier.d.ts /** * Copy public directory to output, preserving structure (no hashing). * Skips `fonts/` since those are copied to dist/assets/ and hashed. */ declare function copyPublicFiles(publicDir: string, outDir: string): void; //#endregion //#region src/assets/hasher.d.ts /** * Demand-driven asset pipeline. * * Instead of blindly copying all content assets to dist, this: * 1. Hashes pre-existing dist/assets/ files (CSS, JS, fonts — already there from bundling) * 2. Scans generated HTML for /assets/* references * 3. For each referenced content asset not yet in dist, finds the source * file in the content directory, copies it with a content hash * 4. Rewrites all HTML references to hashed paths * * Content assets are only copied if actually referenced in the output HTML. * Public assets (favicons, robots.txt) are handled separately by copyPublicFiles. */ /** * Hash assets and rewrite HTML references. * * @param outDir - The dist output directory * @param contentDir - The content source directory (for finding referenced assets) */ declare function hashAssets(outDir: string, contentDir: string | string[]): void; //#endregion //#region src/assets/images.d.ts declare const CONVERTIBLE_IMAGE_EXTS: Set; declare const GENERATED_IMAGE_FORMATS: readonly ["avif", "webp"]; type GeneratedImageFormat = (typeof GENERATED_IMAGE_FORMATS)[number]; /** * Maximum width (in pixels) of the rendered display variants (avif/webp). * Designed for ~800px content columns at 2x DPR. */ declare const DISPLAY_MAX_WIDTH = 1600; /** * Maximum width (in pixels) of the zoom variant served to the full-screen * image-zoom modal. Smaller-than-cap sources keep their native width. */ declare const ZOOM_MAX_WIDTH = 4800; /** File-name suffix used by the zoom variant: `.zoom.webp`. */ declare const ZOOM_VARIANT_SUFFIX = ".zoom.webp"; type LocalImageDimensions = { width: number; height: number; }; declare function getLocalImageDimensions(sourcePath: string): Promise; declare function isConvertibleImagePath(assetPath: string): boolean; declare function getGeneratedImageVariantPath(assetPath: string, format: GeneratedImageFormat): string; /** * Path of the zoom variant generated next to the display variants: * `path/to/foo.png` → `path/to/foo.zoom.webp`. */ declare function getZoomImageVariantPath(assetPath: string): string; declare function resolveGeneratedImageSourceAssetPath(assetPath: string, assets: ContentAssetMap): string | undefined; declare function resolveGeneratedImageSourcePath(assetPath: string, assets: ContentAssetMap): string | undefined; declare function renderGeneratedImageVariant(sourcePath: string, format: GeneratedImageFormat, options?: { maxWidth?: number; }): Promise; /** * Render the dedicated zoom variant for a convertible source image. * Always webp; capped at `ZOOM_MAX_WIDTH` but never upscaled. */ declare function renderZoomImageVariant(sourcePath: string): Promise; declare function emitGeneratedImageVariants(assetsDir: string, assets: ContentAssetMap): Promise; //#endregion //#region src/assets/index.d.ts /** File extensions recognized as content companion assets. */ declare const CONTENT_ASSET_EXTS: Set; /** * Directory-preserving companion asset map. * * Assets are keyed by their relative path from the content root * (e.g., `"articles/foo/diagram.svg"`), which prevents basename * collisions when multiple content entries share generic filenames. */ type ContentAssetMap = { /** Relative path from content root → absolute source path */byPath: Map; /** Original basename → relative paths (for rewrite lookup) */ byBasename: Map; }; /** * Walk content directories and collect companion asset files (images, SVGs, etc.) * keyed by their relative path from each content root. */ declare function collectContentAssets(contentDirs: string[]): ContentAssetMap; //#endregion export { CONTENT_ASSET_EXTS, CONVERTIBLE_IMAGE_EXTS, ContentAssetMap, DISPLAY_MAX_WIDTH, GENERATED_IMAGE_FORMATS, type GeneratedImageFormat, type LocalImageDimensions, ZOOM_MAX_WIDTH, ZOOM_VARIANT_SUFFIX, collectContentAssets, copyPublicFiles, emitGeneratedImageVariants, getGeneratedImageVariantPath, getLocalImageDimensions, getZoomImageVariantPath, hashAssets, isConvertibleImagePath, renderGeneratedImageVariant, renderZoomImageVariant, resolveGeneratedImageSourceAssetPath, resolveGeneratedImageSourcePath }; //# sourceMappingURL=index.d.mts.map