diff --git a/types/cacache/cacache-tests.ts b/types/cacache/cacache-tests.ts index d4d60c032015f5..e143b8705748f8 100644 --- a/types/cacache/cacache-tests.ts +++ b/types/cacache/cacache-tests.ts @@ -32,6 +32,10 @@ cacache.get.stream.byDigest(cachePath, "sha512-SoMeDIGest+64==").pipe(fs.createW cacache.get.info(cachePath, "my-thing").then(() => {}); +cacache.get.info(cachePath, "my-thing", { memoize: true }).then(() => {}); + +cacache.get.info(cachePath, "my-thing", { memoize: new Map() }).then(() => {}); + cacache.get.hasContent(cachePath, "sha521-NOT+IN/CACHE==").then((res) => { res; // $ExpectType HasContentObject | false }); diff --git a/types/cacache/index.d.ts b/types/cacache/index.d.ts index c6a54989049b33..e8865f55861b66 100644 --- a/types/cacache/index.d.ts +++ b/types/cacache/index.d.ts @@ -79,6 +79,8 @@ export namespace get { size?: number | undefined; } + type InfoOptions = Pick; + interface GetStreamEvents extends Minipass.Events { // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type integrity: [integrity: string]; @@ -116,7 +118,7 @@ export namespace get { * Looks up `key` in the cache index, returning information about the entry * if one exists. */ - function info(cachePath: string, key: string): Promise; + function info(cachePath: string, key: string, opts?: InfoOptions): Promise; /** * Returns a Readable Stream of the cached data identified by `key`.