UNPKG

@mini-umi/core

Version:
66 lines (65 loc) 1.56 kB
import { ICommand } from "./command"; import { Plugin } from "./plugin"; import { Hook } from "./hook"; import { Config, Env } from "./config/config"; import { UserConfig } from "./types"; export declare enum ApplyPluginsType { add = "add", modify = "modify", event = "event" } declare type Cmmands = { [key: string]: ICommand; }; declare type hooksByPluginId = { [id: string]: Hook[]; }; declare type hooks = { [key: string]: Hook[]; }; export declare class Core { private opts; cwd: string; env: Env; commands: Cmmands; plugins: string[]; hooksByPluginId: hooksByPluginId; hooks: hooks; pluginMethods: Record<string, { plugin: Plugin; fn: Function; }>; configManager: Config | undefined; userConfig: UserConfig | undefined; config: UserConfig | undefined; userPlugins: string[]; applyPlugins: (opts: { key: string; type?: ApplyPluginsType; initialValue?: any; args?: any; sync?: boolean; }) => Promise<any> | null; constructor(opts: { cwd: string; env: Env; presets?: string[]; plugins: string[]; defaultConfigFiles?: string[]; }); run(opts: { name: string; args?: any; }): Promise<void>; initPreset(opts: { preset: Plugin; presets: string[]; plugins: string[]; }): Promise<void>; initPlugin(opts: { plugin: Plugin; presets?: string[]; plugins?: string[]; }): Promise<any>; } export {};