///
import * as events from 'events';
import { Flow as FlowDefinition, Node, NodeDefinition, NodeDefinitions, NodeDependencyTypes } from '@chix/common';
import { ILoader, LoaderResponse } from './interfaces';
import { DependencyManager, NodeDefinitionManager, NodeDefinitionProviderMap } from './lib';
import { Dependencies, DependencyTypes, LoadDefinitionResult, LoadNodeResult, ProviderDef, Workload } from './types';
/**
* Loader
*
* This is the base loader class
* Ít can be used to implement a definition loader
* for Chix
*
* @api public
* @author Rob Halff
* @constructor
*/
export declare class Loader extends events.EventEmitter implements ILoader {
getNodeSource: (provider: string, ns: string, name: string) => NodeDefinition | FlowDefinition;
protected dependencyManager: DependencyManager;
protected nodeDefinitionManager: NodeDefinitionManager;
constructor();
/**
* This is the main method all child classes should implement.
*
* @param {FlowDefinition[]} _flows
* @param {boolean} _update
* @returns {Promise}
*/
load(_flows: FlowDefinition | FlowDefinition[], _update?: boolean): Promise;
loadNodeDefinitionFrom(provider: string, ns: string, name: string): Promise;
/**
* Loader itself only expects preloaded nodes.
* There is no actual load going on.
*
* Remote loader *does* implement loading.
*
* @param {ProviderDef} providerDef
* @returns {Promise<{nodeDef: NodeDefinition | {}}>}
*/
loadNode(providerDef: ProviderDef): Promise;
/**
* loop the nodes, detect what provider they expect
* if they do not have a provider we will use the default,
* if the flow has set it's own default we will use that.
* the default within a flow is the one without namespace
*/
getWorkLoad(flows: FlowDefinition[], defaultProvider: string, update: boolean): Workload;
addNodeDefinitions(identifier: string, nodeDefs: NodeDefinitions | Array): void;
addNodeDefinition(identifier: string, nodeDef: NodeDefinition | FlowDefinition): void;
hasNodeDefinition(providerUrl: string, ns: string, name: string): boolean;
getNodeDefinition(node: Node, flow: FlowDefinition): NodeDefinition | FlowDefinition;
getNodeDefinitionFrom(provider: string, ns: string, name: string): FlowDefinition | NodeDefinition;
saveNodeDefinition(_providerLocation: string, _nodeDefinition: NodeDefinition | FlowDefinition): void;
getNodeDefinitions(provider?: string): NodeDefinitions | NodeDefinitionProviderMap;
setNodeDefinitions(nodeDefinitions: NodeDefinitionProviderMap): void;
hasDependencies(type?: DependencyTypes): boolean;
getDependencies(type?: DependencyTypes): Dependencies | NodeDependencyTypes;
setDependencies(dependencies: Dependencies): void;
}