import { Flow as FlowDefinition, NodeDefinitions, NodeDependencies } from '@chix/common'; import { ILoader, LoaderResponse } from './interfaces'; import { LoadNodeResult, RemoteLoader } from './remote'; import { BaseNodeDefinitionLocation } from './types'; export interface LoadFileEvent { path: string; } export interface XCacheFile { dependencies: NodeDependencies; nodeDefinitions: NodeDefinitions; } export interface WriteCacheEvent { file: string; } export interface PurgeCacheEvent { file: string; } export interface LoadCacheEvent { file: string; cache: XCacheFile; } export declare type FSLoaderConfig = { cache?: boolean; purge?: boolean; }; export interface NodeDefinitionLocationFS extends BaseNodeDefinitionLocation { path: string; } /** * Loads and saves definitions from/to the local cache file. */ export declare class FSLoader extends RemoteLoader implements ILoader { opts: FSLoaderConfig; _cacheFile: string; constructor(opts?: FSLoaderConfig); /** * * Loads all definitions from the database. * Any missing pieces will be loaded by remote Loader. * * If you use `update` all definitions in the database will be refreshed. * * @param {Object} flow * @param {Boolean} update */ load(flow: FlowDefinition[] | FlowDefinition, update?: boolean): Promise; /** * * Loads a local file * * @param {NodeDefinitionLocationFS} location */ loadFile(location: NodeDefinitionLocationFS): Promise; /** * * Saves the internal state to disk * * @param {Object} map * @param {Function} callback */ syncState(): void; }