summaryrefslogtreecommitdiff
path: root/node_modules/liquidjs/dist/cache
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/liquidjs/dist/cache')
-rw-r--r--node_modules/liquidjs/dist/cache/cache.d.ts7
-rw-r--r--node_modules/liquidjs/dist/cache/index.d.ts2
-rw-r--r--node_modules/liquidjs/dist/cache/lru.d.ts14
-rw-r--r--node_modules/liquidjs/dist/cache/lru.spec.d.ts1
4 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/liquidjs/dist/cache/cache.d.ts b/node_modules/liquidjs/dist/cache/cache.d.ts
new file mode 100644
index 0000000..57debad
--- /dev/null
+++ b/node_modules/liquidjs/dist/cache/cache.d.ts
@@ -0,0 +1,7 @@
+import type { Template } from '../template/template';
+export interface Cache<T> {
+ write(key: string, value: T): void | Promise<void>;
+ read(key: string): T | undefined | Promise<T | undefined>;
+ remove(key: string): void | Promise<void>;
+}
+export type LiquidCache = Cache<Template[] | Promise<Template[]>>;
diff --git a/node_modules/liquidjs/dist/cache/index.d.ts b/node_modules/liquidjs/dist/cache/index.d.ts
new file mode 100644
index 0000000..66fd9cb
--- /dev/null
+++ b/node_modules/liquidjs/dist/cache/index.d.ts
@@ -0,0 +1,2 @@
+export * from './cache';
+export * from './lru';
diff --git a/node_modules/liquidjs/dist/cache/lru.d.ts b/node_modules/liquidjs/dist/cache/lru.d.ts
new file mode 100644
index 0000000..9532ed1
--- /dev/null
+++ b/node_modules/liquidjs/dist/cache/lru.d.ts
@@ -0,0 +1,14 @@
+import { Cache } from './cache';
+export declare class LRU<T> implements Cache<T> {
+ limit: number;
+ size: number;
+ private cache;
+ private head;
+ private tail;
+ constructor(limit: number, size?: number);
+ write(key: string, value: T): void;
+ read(key: string): T | undefined;
+ remove(key: string): void;
+ clear(): void;
+ private ensureLimit;
+}
diff --git a/node_modules/liquidjs/dist/cache/lru.spec.d.ts b/node_modules/liquidjs/dist/cache/lru.spec.d.ts
new file mode 100644
index 0000000..509db18
--- /dev/null
+++ b/node_modules/liquidjs/dist/cache/lru.spec.d.ts
@@ -0,0 +1 @@
+export {};