weapp-ide-cli
Version:
让微信开发者工具,用起来更加方便!
57 lines (44 loc) • 2.29 kB
text/typescript
declare function runMinidev(argv: readonly string[]): Promise<void>;
declare function promptForCliPath(): Promise<string | null>;
declare function resolveCliPath(): Promise<{
cliPath: string | null;
source: ConfigSource;
}>;
declare function parse(argv: string[]): Promise<void>;
interface BaseConfig {
cliPath: string;
}
type ConfigSource = 'custom' | 'default' | 'missing';
interface ResolvedConfig extends BaseConfig {
source: ConfigSource;
}
interface AliasEntry {
find: string;
replacement: string;
}
declare function createCustomConfig(params: BaseConfig): Promise<string>;
declare const defaultCustomConfigDirPath: string;
declare const defaultCustomConfigFilePath: string;
declare function getConfig(): Promise<ResolvedConfig>;
/**
* 官方微信开发者工具只支持 Windows、macOS, Linux只有社区版 https://github.com/msojocs/wechat-web-devtools-linux
*/
declare const SupportedPlatformsMap: {
readonly Windows_NT: "Windows_NT";
readonly Darwin: "Darwin";
readonly Linux: "Linux";
};
type SupportedPlatform = (typeof SupportedPlatformsMap)[keyof typeof SupportedPlatformsMap];
declare function isOperatingSystemSupported(osName?: string): osName is SupportedPlatform;
declare const operatingSystemName: string;
declare function getDefaultCliPath(targetOs?: string): Promise<string | undefined>;
type ArgvTransform = (argv: readonly string[]) => string[];
/**
* Apply a list of argv transforms in order while keeping the original argv untouched.
*/
declare function transformArgv(argv: readonly string[], transforms: readonly ArgvTransform[]): string[];
declare function createAlias(entry: AliasEntry): ArgvTransform;
declare function createPathCompat(option: string): ArgvTransform;
declare function execute(cliPath: string, argv: string[]): Promise<void>;
declare function resolvePath(filePath: string): string;
export { type ArgvTransform, type BaseConfig, type ConfigSource, type ResolvedConfig, type SupportedPlatform, SupportedPlatformsMap, createAlias, createCustomConfig, createPathCompat, defaultCustomConfigDirPath, defaultCustomConfigFilePath, execute, getConfig, getDefaultCliPath, isOperatingSystemSupported, operatingSystemName, parse, promptForCliPath, resolveCliPath, resolvePath, runMinidev, transformArgv };