UNPKG

@p2olab/pimad-core

Version:

PiMAd (Process-industry-Modular-Automation-description) High level access to automation of modular plants.

47 lines (46 loc) 1.61 kB
import { InitializeProcedureType, ProcedureModel } from './ProcedureModel'; import { Backbone } from '../Backbone'; import PiMAdResponse = Backbone.PiMAdResponse; export interface ServiceFactory { create(): ServiceModel; } declare abstract class AServiceFactory implements ServiceFactory { abstract create(): ServiceModel; } export declare class BaseServiceFactory extends AServiceFactory { create(): ServiceModel; } export declare type InitializeServiceType = InitializeProcedureType & { procedure: ProcedureModel[]; }; export interface ServiceModel extends ProcedureModel { /** * TODO * @param callback - TODO * @returns TODO */ getAllProcedures(callback: (response: PiMAdResponse, procedures: ProcedureModel[]) => void): void; /** * Get a specific procedure of the service object. * @param name - The name of the procedure. * @param callback - A callback function. The response object shows the status (success if object was initialized * || error if not initialized or no match) of the function call via the object-type. The procedure-object is the * requested data. */ getProcedure(name: string, callback: (response: PiMAdResponse, procedure: ProcedureModel) => void): void; /** * TODO * @param instructions - TODO * @returns TODO */ initialize(instructions: InitializeServiceType): boolean; } export declare enum Services { BaseService = 0 } export declare class ServiceVendor { private baseServiceFactory; buy(serviceType: Services): ServiceModel; constructor(); } export {};