libey-ng-component-library 0.0.39 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libey-ng-component-library",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0",
package/public-api.d.ts CHANGED
@@ -17,3 +17,4 @@ export { SignaturePadModule, SignaturePad };
17
17
  export { NgSelectModule } from '@ng-select/ng-select';
18
18
  export { NgbModule } from '@ng-bootstrap/ng-bootstrap';
19
19
  export * from '@popperjs/core';
20
+ export * from './utils/Cache/cache';
@@ -0,0 +1,3 @@
1
+ declare type KeyResolver = (...args: any[]) => string;
2
+ export declare function Cacheable(key: string | KeyResolver, ttlMs?: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
3
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare function getOrFetch<T>(key: string, fetchFn: () => Observable<T>, ttlMs?: number): Observable<T>;
@@ -0,0 +1,3 @@
1
+ export declare function setItem<T>(key: string, value: T, ttlMs: number): void;
2
+ export declare function getItem<T>(key: string): T | null;
3
+ export declare function removeItem(key: string): void;
@@ -0,0 +1,2 @@
1
+ export declare function broadcastInvalidate(key: string): void;
2
+ export declare function onExternalInvalidate(callback: (key: string) => void): void;
@@ -0,0 +1,5 @@
1
+ export interface CacheEntry<T> {
2
+ version: number;
3
+ data: T;
4
+ expiresAt: number;
5
+ }
@@ -0,0 +1,11 @@
1
+ import { setItem, getItem } from './cache-storage';
2
+ import { getOrFetch } from './cache-helpers';
3
+ declare function invalidate(key: string): void;
4
+ export declare const cache: {
5
+ get: typeof getItem;
6
+ set: typeof setItem;
7
+ invalidate: typeof invalidate;
8
+ getOrFetch: typeof getOrFetch;
9
+ };
10
+ export * from './cache-types';
11
+ export * from './cache-decorator';