From 37f0f77f3099959ed4033f7610defd39884450aa Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 26 Oct 2024 11:15:04 +0200 Subject: [PATCH] typings: fix `ModulesBinding` types --- 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 }