From c2fcda45ca5ce2615bbf493764d6fdf4c8ba1356 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 2 Nov 2024 16:36:49 +0000 Subject: [PATCH] typings: fix `ModulesBinding` types PR-URL: https://github.com/nodejs/node/pull/55549 Refs: https://github.com/nodejs/node/pull/55412/files#r1817708918 Reviewed-By: Jacob Smith Reviewed-By: Marco Ippolito --- typings/internalBinding/modules.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/typings/internalBinding/modules.d.ts b/typings/internalBinding/modules.d.ts index 7d35b864dae356..e19c662ded3379 100644 --- a/typings/internalBinding/modules.d.ts +++ b/typings/internalBinding/modules.d.ts @@ -9,7 +9,7 @@ export type PackageConfig = { export type DeserializedPackageConfig = { data: PackageConfig, exists: boolean, - path: URL['pathname'], + path: string, } export type SerializedPackageConfig = [ PackageConfig['name'], @@ -22,9 +22,10 @@ export type SerializedPackageConfig = [ export interface ModulesBinding { readPackageJSON(path: string): SerializedPackageConfig | undefined; - getNearestParentPackageJSON(path: string): SerializedPackageConfig | undefined - getNearestRawParentPackageJSON(origin: URL['pathname']): [ReturnType, DeserializedPackageConfig['path']] | undefined getNearestParentPackageJSONType(path: string): PackageConfig['type'] + getNearestParentPackageJSON(path: string): SerializedPackageConfig | undefined getPackageScopeConfig(path: string): SerializedPackageConfig | undefined - getPackageJSONScripts(): string | undefined + enableCompileCache(path?: string): { status: number, message?: string, directory?: string } + getCompileCacheDir(): string | undefined + flushCompileCache(keepDeserializedCache?: boolean): void }