UNPKG

1.12 kBTypeScriptView Raw
1import { Flow as FlowDefinition } from '@chix/common';
2import { ILoader, LoaderResponse } from '@chix/loader';
3import { RemoteLoader } from '@chix/loader-remote';
4import { FSLoaderConfig, LoadNodeResult, NodeDefinitionLocationFS } from './types';
5/**
6 * Loads and saves definitions from/to the local cache file.
7 */
8export declare class FSLoader extends RemoteLoader implements ILoader {
9 opts: FSLoaderConfig;
10 _cacheFile: string;
11 constructor(opts?: FSLoaderConfig);
12 /**
13 *
14 * Loads all definitions from the database.
15 * Any missing pieces will be loaded by remote Loader.
16 *
17 * If you use `update` all definitions in the database will be refreshed.
18 *
19 * @param {Object} flow
20 * @param {Boolean} update
21 */
22 load(flow: FlowDefinition[] | FlowDefinition, update?: boolean): Promise<LoaderResponse>;
23 /**
24 *
25 * Loads a local file
26 *
27 * @param {NodeDefinitionLocationFS} location
28 */
29 loadFile(location: NodeDefinitionLocationFS): Promise<LoadNodeResult>;
30 /**
31 * Saves the internal state to disk
32 */
33 syncState(): void;
34}