import type { CodePatcher } from "@opennextjs/aws/build/patch/codePatcher.js"; /** * ast-grep rule replacing the body of `getModuleLoadingSignal()` to scope the signal to the request. * * Inside a request, the signal is created lazily and stored as `moduleLoadingSignal` on the OpenNext request * store (`globalThis.__openNextAls`). Outside a request, the original module-level variable is used. * * The constructor arguments are forwarded as-is: Next.js 15 calls `new CacheSignal()` while Next.js 16 calls * `new CacheSignal(null)`. */ export declare const moduleLoadingSignalRule = "\nrule:\n kind: statement_block\n inside:\n kind: function_declaration\n field: body\n has:\n field: name\n regex: ^getModuleLoadingSignal$\n has:\n pattern: $SIGNAL = new $CACHE_SIGNAL.CacheSignal($$$ARGS)\n stopBy: end\nfix: |-\n {\n const requestStore = globalThis.__openNextAls?.getStore();\n if (requestStore) {\n return requestStore.moduleLoadingSignal ??= new $CACHE_SIGNAL.CacheSignal($$$ARGS);\n }\n return $SIGNAL ??= new $CACHE_SIGNAL.CacheSignal($$$ARGS);\n }\n"; export declare const patchModuleLoadingSignal: CodePatcher;