UNPKG

@szzbmy/lowcode-cli

Version:

🐇 lowcode-cli is an efficient cli tool for Rabbitpre plugin component secondary development. ❤️

64 lines (63 loc) 2.44 kB
/// <reference types="node" /> import http from 'http'; import { ConfigItem, Workspace, LaunchConfig, LaunchInterface, DebugConfig } from './type'; /** * 根据文件/文件夹相对当前文件夹路径判断是否存在 * @param relativePath 相对路径 * @returns */ export declare function isFileExisted(relativePath: string): boolean; /** * 生成调试 id * @param length * @returns */ export declare function createDebugId(length: number): string; /** * 创建文件,如果文件所在文件夹不存在,先创建文件夹 * @param {Record<string, any>} content * @param {String} filePath */ export declare function writeFileAndMkdir(content: Record<string, any>, filePath: string): Promise<void>; /** 检查端口是否占用 */ export declare function checkPortAvailable(port: number): Promise<unknown>; export declare function checkServersStarted(launchConfig: LaunchConfig): Promise<boolean>; /** * 创建默认启动配置 * @returns {Promise<LaunchConfig>} 启动配置信息 */ export declare function createDefaultLaunchConfig(): Promise<LaunchConfig>; /** * 创建 launch.json */ export declare function createLaunchJson(): Promise<void>; /** * 获取 launch.json 文件数据 * @returns */ export declare function getLaunchJson(): LaunchInterface | null; /** * 更新 launch.json 文件 * @param configJson 更新信息 */ export declare function updateLaunchConfigJson(configJson: LaunchInterface): void; /** * 获取配置根据调试id * @param {String} debugId 调试id * @returns */ export declare function getLaunchConfigByDebugId(debugId: string): LaunchConfig | null | undefined; /** 更新 launch 配置 */ export declare function updateLaunchConfig(configInfo: Partial<LaunchConfig>): Promise<void>; /** * 根据config配置获取调试配置 * @param configJson config 配置信息 * @param machineDebugCdn 真机调试 cdn * @returns */ export declare function getDebugConfigByConfigJson(configJson: Record<string, any>, cdnUrl?: string): DebugConfig; export declare function getDebugConfig(debugPath: Workspace): DebugConfig | undefined; export declare function getDebugConfigsByLaunchConfig(launchConfig?: LaunchConfig): DebugConfig[]; export declare function getLaunchConfigList(): ConfigItem[]; export declare function createLowcodeDebugServer(launchConfig: LaunchConfig): Promise<http.Server | undefined>; export declare const openDebugUrl: (openDebugUrl: string) => void;