import { Logger } from 'xhs-mp-shared'; import { LoginManager } from './login'; import { Storage } from './utils/storage'; export interface IVerbose { verbose?: boolean; from?: 'cli' | 'code' | 'axios'; } export interface IGlobalConfig { proxy?: string; } export interface IAppConfig { token?: string; [key: string]: any; } export interface IAppConfigMap { [appId: string]: IAppConfig; } export type ILoginConfig = IVerbose & { type?: 'qrcode'; }; export type ILogoutConfig = IVerbose & {}; export interface ILibFeatures { supportV2?: boolean; supportVdom?: boolean; } export interface IBaseActionOpts { project: { projectPath: string; watch?: boolean; }; buildConfig?: { compileDir?: string; nodeJsPath?: string; libFeatures?: ILibFeatures; }; } export type IPreivewOpts = IBaseActionOpts & IVerbose & { entry?: { path: string; query?: string; launchMode?: string; }; }; export type IUploadOpts = IBaseActionOpts & IVerbose & { version: string; desc: string; progressCallback?: any; }; export interface ICoreOpts { scene: 'cli' | 'code'; } export declare class Core { private globalConfig; private appConfigMap; private projectMap; private compilerManagerMap; storage: Storage; logger: Logger; loginManager: LoginManager; scene: string; constructor(opts: ICoreOpts); setGlobalConfig(config?: IGlobalConfig): void; getGlobalConfig(): IGlobalConfig; setAppConfig(appConfig?: IAppConfig): void; getAppConfig(appId: any): IAppConfig; private createOrGetProject; private getCompilerManager; login(opts?: ILoginConfig): Promise; logout(opts: ILogoutConfig): void; isTokenAuth(appId: any): boolean; getTokenParams(appId: any): { cliToken: any; nonce: string; appId: any; }; checkAppId(appId: any): void; preview(opts: IPreivewOpts): Promise; upload(opts: IUploadOpts): Promise; }