@feflow/cli
Version:
A front-end flow tool.
105 lines • 2.9 kB
TypeScript
import Feflow from '..';
export declare enum CommandType {
NATIVE_TYPE = "native",
PLUGIN_TYPE = "plugin",
INTERNAL_PLUGIN_TYPE = "devtool",
UNIVERSAL_PLUGIN_TYPE = "universal",
UNKNOWN_TYPE = "unknown"
}
export declare const LOAD_PLUGIN: number;
export declare const LOAD_DEVKIT: number;
export declare const LOAD_UNIVERSAL_PLUGIN: number;
export declare const LOAD_ALL: number;
interface PluginItem {
commands: Array<{
name: string;
path?: string;
version?: string;
}>;
path?: string;
type: CommandType;
}
interface PluginInfo {
[key: string]: PluginItem;
}
interface PickMap {
[CommandType.PLUGIN_TYPE]?: PluginInfo;
[CommandType.UNIVERSAL_PLUGIN_TYPE]?: PluginInfo;
[CommandType.NATIVE_TYPE]: PluginInfo;
[CommandType.INTERNAL_PLUGIN_TYPE]: PluginInfo;
}
interface Cache {
commandPickerMap?: PickMap;
version: string;
}
interface CmdMap {
commands: Array<{
[key: string]: {
name: string;
version: string;
};
}>;
}
declare class TargetPlugin {
path: string;
type: CommandType;
pkg?: string;
constructor(type: CommandType, path: string, pkg: string);
}
declare class TargetUniversalPlugin {
type: CommandType;
version: string;
pkg: string;
constructor(type: CommandType, version: string, pkg: string);
}
export declare class CacheController {
ctx: Feflow;
cache?: Cache;
lastCommand: string;
lastVersion: string;
lastStore: Record<string, {
pluginName: string;
}>;
subCommandMap: {
[key: string]: string[];
};
subCommandMapWithVersion: CmdMap;
root: string;
cacheFilePath: string;
cacheVersion: string;
pickOrder: CommandType[];
constructor(ctx: Feflow);
registerSubCommand(type: CommandType, store: Record<string, any>, pluginName?: string, version?: string): void;
initCacheFile(): void;
writeCache(filePath?: string): void;
updateCache(type: CommandType): void;
getAllCommandPickerMap(): Partial<PickMap>;
getNativeMap(): PluginInfo;
getInternalPluginMap(): PluginInfo;
getPluginMap(): PluginInfo;
getUniversalMap(): PluginInfo;
getCache(): Cache | undefined;
removeCache(name: string): void;
getCommandPath(cmd: string): TargetPlugin | TargetUniversalPlugin;
}
export default class CommandPicker {
root: string;
cmd: string;
ctx: Feflow;
isHelp: boolean;
cacheController: CacheController;
supportType: CommandType[];
homeRunCmd: string[];
constructor(ctx: Feflow, cmd?: string);
loadHelp(): Promise<void>;
isAvailable(): boolean;
checkCommand(): Promise<void>;
getCommandSource(path: string): string;
pickCommand(): Promise<void>;
getCmdInfo(): {
path: string;
type: CommandType;
};
}
export {};
//# sourceMappingURL=index.d.ts.map