pandora
Version:
154 lines (153 loc) • 5.37 kB
TypeScript
import { Entry, EntryClass, AppletRepresentation, ApplicationRepresentation, ApplicationStructureRepresentation, ProcessRepresentation, ServiceRepresentation, ComplexApplicationStructureRepresentation, CategoryReg } from '../domain';
import { ProcfileReconcilerAccessor } from './ProcfileReconcilerAccessor';
/**
* Class ProcfileReconciler
* TODO: Add more description
*/
export declare class ProcfileReconciler {
appRepresentation: ApplicationRepresentation;
procfileBasePath: string;
protected discovered: boolean;
protected procfileReconcilerAccessor: ProcfileReconcilerAccessor;
protected defaultAppletCategory: CategoryReg;
protected defaultServiceCategory: CategoryReg;
protected configuratorClass: EntryClass;
protected environmentClass: EntryClass;
protected processes: Array<ProcessRepresentation>;
protected services: Array<ServiceRepresentation>;
protected applets: Array<AppletRepresentation>;
protected readonly uniqServices: Array<ServiceRepresentation>;
protected readonly uniqApplets: Array<AppletRepresentation>;
protected readonly appDir: string;
constructor(appRepresentation: ApplicationRepresentation);
/**
* Find out all possibly profile.js paths
* @return {Array}
*/
resovle(): any[];
/**
* Discover procfile.js in appDir, and apply them.
*/
discover(): void;
/**
* callProcfile required a argument as typed function, then call that function, pass ProcfileReconcilerAccessor as the first argument of that function.
* @param entryFn
* @param path
*/
callProcfile(entryFn: any, path?: any): void;
/**
* Normalize entry class, entry class such as applet class, service class and configurator class
* Those classes have a lazy way to represent, it can get a relative path
* this method will wrap that relative path to a real class
* @param entry
* @return {EntryClass}
*/
normalizeEntry(entry: any): EntryClass;
/**
* Convert class name to instance name
* @param {string} name
* @return {string}
*/
normalizeName(name: string): string;
/**
* setDefaultAppletCategory
* @param {CategoryReg} name
*/
setDefaultAppletCategory(name: CategoryReg): void;
/**
* getDefaultAppletCategory
* @return {CategoryReg}
*/
getDefaultAppletCategory(): string;
/**
* setDefaultServiceCategory
* @param {CategoryReg} name
*/
setDefaultServiceCategory(name: CategoryReg): void;
/**
* getDefaultServiceCategory
* @return {CategoryReg}
*/
getDefaultServiceCategory(): string;
/**
* Define process representation
* @param processRepresentation
* @return {ProcessRepresentation}
*/
defineProcess(processRepresentation: any): ProcessRepresentation;
/**
* Get a process representation by name
* @param processName
* @return {ProcessRepresentation}
*/
getProcessByName(processName: any): ProcessRepresentation;
/**
* Inject configurator class
* @param {Entry} entry
*/
injectConfigurator(entry: Entry): void;
/**
* Get configurator class
* @return {EntryClass}
*/
getConfigurator(): EntryClass;
/**
* Inject environment class
* @param {Entry} entry
*/
injectEnvironment(entry: Entry): void;
/**
* Get environment class
* @return {EntryClass}
*/
getEnvironment(): EntryClass;
/**
* Inject service class
* @param serviceRepresentation
* @return {ServiceRepresentation}
*/
injectService(serviceRepresentation: any): ServiceRepresentation;
/**
* Get a service representation by entry string or class
* @param lookingFor
* @return {ServiceRepresentation}
*/
getServiceByEntry(lookingFor: any): ServiceRepresentation;
/**
* Get services by category
* @param {string} category
* @return {ServiceRepresentation[]}
*/
getServicesByCategory(category: string): ServiceRepresentation[];
/**
* Inject applet class
* @param {AppletRepresentation} appletRepresentation
* @return {{appletName: string; category: (CategoryReg | any); appletEntry: EntryClass}}
*/
injectApplet(appletRepresentation: any): any;
/**
* Get a applet representation by entry string or class
* @param lookingFor
* @return {ApplicationRepresentation}
*/
getAppletByEntry(lookingFor: any): AppletRepresentation;
/**
* Get applets by category
* @param {string} category
* @return {AppletRepresentation[]}
*/
getAppletsByCategory(category: string): AppletRepresentation[];
protected getAvailableProcessMap(): {};
/**
* Get the application's structure
* @returns {ApplicationStructureRepresentation}
*/
getApplicationStructure(): ApplicationStructureRepresentation;
/**
* Get the complex application's structure
* @returns {ApplicationStructureRepresentation}
*/
getComplexApplicationStructureRepresentation(): ComplexApplicationStructureRepresentation;
static echoComplex(appRepresentation: ApplicationRepresentation): void;
static getComplexViaNewProcess(appRepresentation: ApplicationRepresentation): Promise<ComplexApplicationStructureRepresentation>;
}