astroboy
Version:
Astroboy(阿童木)is a Nodejs SFB(Separation of Front and Back ends) framework, built on koa2.
63 lines (62 loc) • 1.76 kB
TypeScript
import { EntryItem } from 'fast-glob/out/types';
import { PureObject, IDir, ILoaderOptions, IPluginEntry, IBaseApplication } from '../definitions/core';
/**
* ### Base Loader
*
* @author Big Mogician
* @export
* @abstract
* @class Loader
* @template F
* @template A
*/
export declare abstract class Loader<F extends PureObject, A extends IBaseApplication<F>> {
protected dirs: IDir[];
protected app: A;
protected config: F;
constructor(options?: Partial<ILoaderOptions<F, A>>);
abstract load(): Promise<void>;
/**
* ### Resolve Extensions
*
* @author Big Mogician
* @protected
* @param {string} path
* @param {boolean} [resolveDevide=false]
* @returns
* @memberof Loader
*/
protected resolveExtensions(path: string, resolveDevide?: boolean): string;
/**
* ### Get Dirs
*
* @author Big Mogician
* @protected
* @param {(string | string[])} patterns
* @param {(files: EntryItem[]) => void} callback
* @memberof Loader
*/
protected globDirs(patterns: string | string[]): Promise<EntryItem[]>;
/**
* ### Resolve Dir
*
* @author Big Mogician
* @protected
* @param {string} baseDir
* @param {(string | string[])} patterns
* @param {(files: EntryItem[]) => void} callback
* @memberof Loader
*/
protected globDir(baseDir: string, patterns: string | string[]): Promise<EntryItem[]>;
/**
* ### 获取插件的根目录
* - 要求插件的入口文件必须放在插件根目录
*
* @author Big Mogician
* @protected
* @param {IPluginEntry} plugin
* @returns
* @memberof Loader
*/
protected getPluginPath(plugin: IPluginEntry): string;
}