From f8c5a40eca90d680b42b1b9748093deff51b54d5 Mon Sep 17 00:00:00 2001 From: WouterGit Date: Mon, 22 Jun 2020 13:06:05 +0200 Subject: [PATCH 1/2] Info method type overload to allow specific return types of info method --- dist/cachefactory.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/cachefactory.d.ts b/dist/cachefactory.d.ts index 8890922..1bdc635 100644 --- a/dist/cachefactory.d.ts +++ b/dist/cachefactory.d.ts @@ -1,3 +1,9 @@ + +interface Info { + (key: string | number): ItemInfo; + (): CacheInfo; +} + export class CacheFactory { clearAll(): void; createCache(id: string, options?: CacheOptions): Cache; @@ -20,7 +26,7 @@ export class Cache { disable(): void; enable(): void; get(key: string|number, options?: GetPutOptions): any; - info(key: string|number): CacheInfo|ItemInfo; + info: Info; keys(): (string|number)[]; keySet(): {[key: string]: string|number}; put(key: string|number, value: any, options?: GetPutOptions): any; From ff9b735ba5836e9d3cd85b50dd332855b2be4806 Mon Sep 17 00:00:00 2001 From: WouterGit Date: Mon, 22 Jun 2020 13:10:56 +0200 Subject: [PATCH 2/2] Info method type overload to allow specific return types of info method --- dist/cachefactory.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/dist/cachefactory.d.ts b/dist/cachefactory.d.ts index 1bdc635..43c5aed 100644 --- a/dist/cachefactory.d.ts +++ b/dist/cachefactory.d.ts @@ -1,4 +1,3 @@ - interface Info { (key: string | number): ItemInfo; (): CacheInfo;