mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.3 KiB
29 lines
1.3 KiB
import FMCStore from "../store.js";
|
|
import type { FMCCacheContent, FMCStoreOptions } from "../store.js";
|
|
import { FetchCacheOptions } from "../fetch-cache.js";
|
|
interface FMCFileStoreOptions extends FMCStoreOptions {
|
|
location?: string;
|
|
}
|
|
/**
|
|
* Used to instantiate a new file system store.
|
|
* @param options e.g. { location: "./tests/fixtures/http" }
|
|
* @returns fs store instance, to pass to `createCachingMock`
|
|
* @example
|
|
* ```ts
|
|
* import createFetchCache from "fetch-mock-cache"; // or /runtimes/deno.js etc
|
|
* import Store from "fetch-mock-cache/stores/fs";
|
|
* const fetchCache = createFetchCache({ Store });
|
|
* ```
|
|
*/
|
|
export default class FMCFileSystemStore extends FMCStore {
|
|
_createdCacheDir: boolean;
|
|
_cwd: string;
|
|
_location: string;
|
|
constructor(options: FMCFileStoreOptions);
|
|
cache_dir(filename: string): Promise<string>;
|
|
idFromRequest(request: FMCCacheContent["request"], options?: FetchCacheOptions): Promise<string>;
|
|
pathFromRequest(request: FMCCacheContent["request"], options?: FetchCacheOptions): Promise<string>;
|
|
fetchContent(request: FMCCacheContent["request"], options?: FetchCacheOptions): Promise<FMCCacheContent | null>;
|
|
storeContent(content: FMCCacheContent, options?: FetchCacheOptions): Promise<void>;
|
|
}
|
|
export {};
|
|
|