fix: support passing arguments when pushing a service

This commit is contained in:
DanyLE 2023-06-06 21:53:22 +02:00 committed by Dany LE
parent bff2c94fa9
commit a00acf4bbf
3 changed files with 8 additions and 5 deletions

5
d.ts/antos.d.ts vendored
View File

@ -1191,9 +1191,10 @@ declare namespace OS {
* *
* @export * @export
* @param {string} ph * @param {string} ph
* @param {AppArgumentsType[]} [params] service arguments
* @returns {Promise<PM.ProcessType>} * @returns {Promise<PM.ProcessType>}
*/ */
function pushService(ph: string): Promise<PM.ProcessType>; function pushService(ph: string, params?: AppArgumentsType[]): Promise<PM.ProcessType>;
/** /**
* Synchronously start a list of services * Synchronously start a list of services
* *
@ -10802,7 +10803,7 @@ declare namespace OS {
* @export * @export
* @param {string} app class name string * @param {string} app class name string
* @param {ProcessTypeClass} cls prototype class * @param {ProcessTypeClass} cls prototype class
* @param {GUI.AppArgumentsType[]} [args] process arguments * @param {AppArgumentsType[]} [args] process arguments
* @returns {Promise<ProcessType>} a promise on the created process * @returns {Promise<ProcessType>} a promise on the created process
*/ */
function createProcess(app: string, cls: ModelTypeClass, args?: AppArgumentsType[]): Promise<ProcessType>; function createProcess(app: string, cls: ModelTypeClass, args?: AppArgumentsType[]): Promise<ProcessType>;

View File

@ -644,9 +644,10 @@ namespace OS {
* *
* @export * @export
* @param {string} ph * @param {string} ph
* @param {AppArgumentsType[]} [params] service arguments
* @returns {Promise<PM.ProcessType>} * @returns {Promise<PM.ProcessType>}
*/ */
export function pushService(ph: string): Promise<PM.ProcessType> { export function pushService(ph: string, params?: AppArgumentsType[]): Promise<PM.ProcessType> {
return new Promise(async function (resolve, reject) { return new Promise(async function (resolve, reject) {
const arr = ph.split("/"); const arr = ph.split("/");
const srv = arr[1]; const srv = arr[1];
@ -662,7 +663,8 @@ namespace OS {
} }
const d = await PM.createProcess( const d = await PM.createProcess(
srv, srv,
application[srv] application[srv],
params
); );
return resolve(d); return resolve(d);
} }

View File

@ -35,7 +35,7 @@ namespace OS {
* @export * @export
* @param {string} app class name string * @param {string} app class name string
* @param {ProcessTypeClass} cls prototype class * @param {ProcessTypeClass} cls prototype class
* @param {GUI.AppArgumentsType[]} [args] process arguments * @param {AppArgumentsType[]} [args] process arguments
* @returns {Promise<ProcessType>} a promise on the created process * @returns {Promise<ProcessType>} a promise on the created process
*/ */
export function createProcess( export function createProcess(