add more docs

This commit is contained in:
lxsang
2020-06-18 17:09:00 +02:00
parent 023e61c01e
commit 4a941f0467
8 changed files with 1024 additions and 299 deletions

View File

@ -1,19 +1,38 @@
namespace OS {
/**
* This namespace dedicated to all operations related to system
* process management
*/
export namespace PM {
export type ProcessType = application.BaseApplication | application.BaseService;
/**
* A process is either an instance of an application or a service
*/
export type ProcessType =
| application.BaseApplication
| application.BaseService;
/**
* Alias to all classes that extends [[BaseModel]]
*/
export type ModelTypeClass = {
new <T extends BaseModel>(args: AppArgumentsType[]): T;
};
/**
* Process id allocator, when a new process is created, the value of
* this variable is increased
*/
export var pidalloc: number = 0;
/**
* All running processes is stored in this variables
*/
export var processes: GenericObject<BaseModel[]> = {};
/**
*
* Create a new process of application or service
*
* @export
* @param {string} app
* @param {ProcessTypeClass} cls
* @param {GUI.AppArgumentsType[]} [args]
* @returns {Promise<ProcessType>}
* @param {string} app class name string
* @param {ProcessTypeClass} cls prototype class
* @param {GUI.AppArgumentsType[]} [args] process arguments
* @returns {Promise<ProcessType>} a promise on the created process
*/
export function createProcess(
app: string,
@ -68,7 +87,7 @@ namespace OS {
}
/**
*
* Get the reference to a process using its id
*
* @export
* @param {number} pid
@ -94,10 +113,10 @@ namespace OS {
}
/**
*
* Kill a process
*
* @export
* @param {OS.GUI.BaseModel} app
* @param {OS.GUI.BaseModel} app reference to the process
* @returns {void}
*/
export function kill(app: BaseModel): void {
@ -119,11 +138,11 @@ namespace OS {
}
/**
*
* Kill all process of an application or service
*
* @export
* @param {string} app
* @param {boolean} force
* @param {string} app process class name
* @param {boolean} force force exit all process
* @returns {void}
*/
export function killAll(app: string, force: boolean): void {