import type { PHP } from './php'; /** * Mounts directories from one PHP instance's filesystem into another using PROXYFS. * * This enables file sharing between PHP instances without duplicating the files in memory. * For example, mounting /wordpress from the parent instance into a child worker allows * both to access the same WordPress installation without copying the entire directory. * * The function automatically patches PROXYFS with mmap support before mounting on * PHP 7+, so libraries like ICU can memory-map data files through the proxied * filesystem. * * Legacy PHP (< 7) skips the mmap patch. PHP 5.x's zend_compile_file * calls mmap() via zend_stream_fixup and trusts fstat() for the buffer * size. When a file is pre-populated in MEMFS before PROXYFS is mounted * over that path (e.g. php.ini written by preRun), fstat() can return * the stale MEMFS size instead of the PROXYFS size, causing the parser * to read past the real EOF and report spurious syntax errors. Without * the mmap patch, Emscripten returns ENOSYS from mmap() and PHP falls * back to a read-based path that handles size mismatches gracefully. * PHP 7+ removed the mmap path from zend_stream_fixup entirely, so the * patch is both safe and needed there (for ICU/intl). * * Mounts are registered via php.mount() so they survive runtime rotation. * When the replica's WASM module is hot-swapped, hotSwapPHPRuntime() * re-applies these mount handlers on the fresh module. * * @param sourceOfTruth - The PHP instance containing the original files * @param replica - The PHP instance that will access files through PROXYFS * @param paths - Absolute paths to mount (e.g., ['/wordpress', '/internal/shared']) */ export declare function proxyFileSystem(sourceOfTruth: PHP, replica: PHP, paths: string[]): Promise; /** * Answers whether the given path is to a shared filesystem. * * @param sourceOfTruth - The PHP instance that is the source of truth. * @param path - The path to check. * @returns True if the path is to a shared filesystem, false otherwise. */ export declare function isPathToSharedFS(sourceOfTruth: PHP, path: string): any;