UNPKG

nope-js-node

Version:

NoPE Runtime for Nodejs. For Browser-Support please use nope-browser

69 lines (68 loc) 2.1 kB
/** * @author Martin Karkowski * @email m.karkowski@zema.de * @desc [description] */ import "reflect-metadata"; import { ValidLoggerDefinition } from "../logger/getLogger"; import { IPackageDescription } from "../types/nope/nopePackage.interface"; import { INopePackageLoader } from "../types/nope/nopePackageLoader.interface"; import { validLayerOrMirror } from "../communication/index.nodejs"; export interface IPackageConfig extends Partial<IPackageDescription<any>> { path: string; } export interface IConfigFile { functions: { path: string; functions: string[]; }[]; packages: IPackageConfig[]; connections: { name: validLayerOrMirror; url: string; log: ValidLoggerDefinition; considerConnection: boolean; forwardData: boolean; }[]; config: any; } /** * List the available Packages * * @export * @param {string} [dir='./modules'] * @return {*} */ export declare function listPackages(dir?: string): Promise<{ package: IPackageDescription<any>; path: string; }[]>; export declare function listFunctions(dir?: string): Promise<{ content: any; path: string; }[]>; /** * Helper Function to write a default configuration. * * @export * @param {string} [dir='./modules'] * @param {string} [filename=join(resolve(process.cwd()), 'config', 'assembly.json')] */ export declare function writeDefaultConfig(dir?: string, filename?: string): Promise<void>; /** * Function to load the Packages. * * @export * @param {INopePackageLoader} loader * @param {string} filename */ export declare function loadPackages(loader: INopePackageLoader, filename?: string, delay?: number): Promise<void>; /** * Helper to read function provided in the defined configuration. * * @author M.Karkowski * @export * @param {string} [filename=join(resolve(process.cwd()), "config", "assembly.json")] * @return {*} */ export declare function loadFunctions(loader: INopePackageLoader, filename?: string, delay?: number): Promise<any[]>;