UNPKG

@vnxjs/service

Version:
76 lines (75 loc) 2.48 kB
import type { RecursiveTemplate, UnRecursiveTemplate } from '@vnxjs/shared/dist/template'; import type { IPluginContext } from '../types/index'; interface IFileType { templ: string; style: string; config: string; script: string; xs?: string; } interface IWrapper { init?(): void; close?(): void; } declare class Transaction { wrappers: IWrapper[]; perform(fn: (...args: any[]) => void, scope: VnmfPlatformBase, ...args: any[]): Promise<void>; initAll(scope: any): void; closeAll(scope: any): void; addWrapper(wrapper: IWrapper): void; } export declare abstract class VnmfPlatformBase { ctx: IPluginContext; helper: IPluginContext['helper']; config: any; compiler: string; abstract platform: string; abstract globalObject: string; abstract runtimePath: string | string[]; abstract fileType: IFileType; abstract template: RecursiveTemplate | UnRecursiveTemplate; projectConfigJson?: string; vnmfComponentsPath?: string; setupTransaction: Transaction; buildTransaction: Transaction; constructor(ctx: IPluginContext, config: any); /** * 1. Empty dist Folder * 2. Output compile hint * 3. Generate project.config.json */ private setup; private setupImpl; protected emptyOutputDir(): void; protected printDevelopmentTip(platform: string): void; /** * Return to the current item @vnxjs/mini-runner Bag. */ protected getRunner(): Promise<any>; /** * Ready. mini-runner Parameters * @param extraOptions Could not close temporary folder: %s Options Configuration entry */ protected getOptions(extraOptions?: {}): any; /** * Call mini-runner Commence compilation. * @param extraOptions Could not close temporary folder: %s @vnxjs/mini-runner Configuration entry */ private build; private buildImpl; /** * Generate project.config.json * @param src Name of the profile in project source * @param dist Name of the compiled configuration file,Default As 'project.config.json' */ protected generateProjectConfig(src: string, dist?: string): void; /** * Recursively replace object key Value */ protected recursiveReplaceObjectKeys(obj: any, keyMap: any): void; /** * Call mini-runner Turn on the compiler. */ start(): Promise<void>; } export {};