pandora
Version:
A powerful and lightweight application manager for Node.js applications powered by TypeScript.
115 lines (114 loc) • 4.1 kB
TypeScript
import { Entry, EntryClass, 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 defaultServiceCategory: CategoryReg;
protected environmentClass: EntryClass;
protected processes: Array<ProcessRepresentation>;
protected services: Array<ServiceRepresentation>;
protected readonly uniqServices: Array<ServiceRepresentation>;
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 service 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;
/**
* 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 lookingFor
* @return {ProcessRepresentation}
*/
getProcessByName(lookingFor: any): ProcessRepresentation;
/**
* Drop a process representation by name
*/
dropProcessByName(lookingFor: any): void;
/**
* 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 name
* @param lookingFor
* @return {ServiceRepresentation}
*/
getServiceByName(lookingFor: any): ServiceRepresentation;
/**
* Drop a service representation by name
*/
dropServiceByName(lookingFor: any): void;
/**
* Get services by category
* @param {string} category
* @return {ServiceRepresentation[]}
*/
getServicesByCategory(category: string, simple?: any): ServiceRepresentation[];
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, writeTo: string): void;
static getComplexViaNewProcess(appRepresentation: ApplicationRepresentation): Promise<ComplexApplicationStructureRepresentation>;
private processGlobalForProcess(process);
}