lemon-core
Version:
Lemon Serverless Micro-Service Platform
49 lines (48 loc) • 2.14 kB
TypeScript
/**
* `engine/index.tx`
* - engine bootloader
*
*
* @author Steve Jung <steve@lemoncloud.io>
* @date 2018-05-23 initial version
* @date 2019-11-26 cleanup and optimized for `lemon-core#v2`
* @date 2022-02-22 cleanup lodash export `_`
*
* @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
*/
import { EngineOption, EngineLogger, EngineConsole, LemonEngine, EngineScope } from './types';
export declare const build_environ: (options: EngineOption) => (name: string, defVal: any) => any;
export declare const build_ts: (options?: EngineOption) => (date?: undefined | number | Date, timeZone?: number) => any;
export declare const RED = "\u001B[31m";
export declare const BLUE = "\u001B[32m";
export declare const YELLOW = "\u001B[33m";
export declare const RESET = "\u001B[0m";
export declare const build_log: ($console: EngineConsole) => EngineLogger;
export declare const build_inf: ($console: EngineConsole) => EngineLogger;
export declare const build_err: ($console: EngineConsole) => EngineLogger;
/** ****************************************************************************************************************
* Common functions.
** ****************************************************************************************************************/
/**
* parrallel actions in list (in batch-size = 10)
*
* @param list any list
* @param callback (item)=>any | Promise<any>
* @param size (optional) size
* @param pos (optional) current pos
* @param result (optional) result set.
*/
export declare const do_serialize: <T, U>(param: T[], callback: (node: T, index: number) => U, size?: number, pos?: number, result?: (Error | U)[]) => Promise<(Error | U)[]>;
/**
* initialize as EngineInterface
*
* ```ts
* import engine from 'lemon-engine';
* const $engine = engine(global, { env: process.env });
* ```
*
* @param scope main scope like global, browser, ...
* @param options configuration.
*/
export declare const buildEngine: (scope?: EngineScope, options?: EngineOption) => LemonEngine;
export default buildEngine;