161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ArkTS
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ci/**
2261847f8eSopenharmony_ci * The process is mainly used to obtain the relevant ID of the process, obtain and modify
2361847f8eSopenharmony_ci * the working directory of the process, exit and close the process.
2461847f8eSopenharmony_ci *
2561847f8eSopenharmony_ci * @namespace process
2661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
2761847f8eSopenharmony_ci * @since 7
2861847f8eSopenharmony_ci */
2961847f8eSopenharmony_ci/**
3061847f8eSopenharmony_ci * The process is mainly used to obtain the relevant ID of the process, obtain and modify
3161847f8eSopenharmony_ci * the working directory of the process, exit and close the process.
3261847f8eSopenharmony_ci *
3361847f8eSopenharmony_ci * @namespace process
3461847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
3561847f8eSopenharmony_ci * @crossplatform
3661847f8eSopenharmony_ci * @since 10
3761847f8eSopenharmony_ci */
3861847f8eSopenharmony_ci/**
3961847f8eSopenharmony_ci * The process is mainly used to obtain the relevant ID of the process, obtain and modify
4061847f8eSopenharmony_ci * the working directory of the process, exit and close the process.
4161847f8eSopenharmony_ci *
4261847f8eSopenharmony_ci * @namespace process
4361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
4461847f8eSopenharmony_ci * @crossplatform
4561847f8eSopenharmony_ci * @atomicservice
4661847f8eSopenharmony_ci * @since 11
4761847f8eSopenharmony_ci */
4861847f8eSopenharmony_cideclare namespace process {
4961847f8eSopenharmony_ci  /**
5061847f8eSopenharmony_ci   * The childprocess object can be used to create a new process.
5161847f8eSopenharmony_ci   *
5261847f8eSopenharmony_ci   * @typedef ChildProcess
5361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
5461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
5561847f8eSopenharmony_ci   * @since 7
5661847f8eSopenharmony_ci   * @test
5761847f8eSopenharmony_ci   */
5861847f8eSopenharmony_ci  export interface ChildProcess {
5961847f8eSopenharmony_ci    /**
6061847f8eSopenharmony_ci     * Return pid is the pid of the current process
6161847f8eSopenharmony_ci     *
6261847f8eSopenharmony_ci     * @type { number }
6361847f8eSopenharmony_ci     * @readonly
6461847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
6561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
6661847f8eSopenharmony_ci     * @since 7
6761847f8eSopenharmony_ci     * @test
6861847f8eSopenharmony_ci     */
6961847f8eSopenharmony_ci    readonly pid: number;
7061847f8eSopenharmony_ci
7161847f8eSopenharmony_ci    /**
7261847f8eSopenharmony_ci     * Return ppid is the pid of the current child process
7361847f8eSopenharmony_ci     *
7461847f8eSopenharmony_ci     * @type { number }
7561847f8eSopenharmony_ci     * @readonly
7661847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
7761847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
7861847f8eSopenharmony_ci     * @since 7
7961847f8eSopenharmony_ci     * @test
8061847f8eSopenharmony_ci     */
8161847f8eSopenharmony_ci    readonly ppid: number;
8261847f8eSopenharmony_ci
8361847f8eSopenharmony_ci    /**
8461847f8eSopenharmony_ci     * Return exitCode is the exit code of the current child process
8561847f8eSopenharmony_ci     *
8661847f8eSopenharmony_ci     * @type { number }
8761847f8eSopenharmony_ci     * @readonly
8861847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
8961847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
9061847f8eSopenharmony_ci     * @since 7
9161847f8eSopenharmony_ci     * @test
9261847f8eSopenharmony_ci     */
9361847f8eSopenharmony_ci    readonly exitCode: number;
9461847f8eSopenharmony_ci
9561847f8eSopenharmony_ci    /**
9661847f8eSopenharmony_ci     * Return boolean is whether the current process signal is sent successfully
9761847f8eSopenharmony_ci     *
9861847f8eSopenharmony_ci     * @type { boolean }
9961847f8eSopenharmony_ci     * @readonly
10061847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
10161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
10261847f8eSopenharmony_ci     * @since 7
10361847f8eSopenharmony_ci     * @test
10461847f8eSopenharmony_ci     */
10561847f8eSopenharmony_ci    readonly killed: boolean;
10661847f8eSopenharmony_ci
10761847f8eSopenharmony_ci    /**
10861847f8eSopenharmony_ci     * Return 'number' is the target process exit code
10961847f8eSopenharmony_ci     *
11061847f8eSopenharmony_ci     * @returns { Promise<number> } Return the target process exit code.
11161847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
11261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
11361847f8eSopenharmony_ci     * @since 7
11461847f8eSopenharmony_ci     * @test
11561847f8eSopenharmony_ci     */
11661847f8eSopenharmony_ci    wait(): Promise<number>;
11761847f8eSopenharmony_ci
11861847f8eSopenharmony_ci    /**
11961847f8eSopenharmony_ci     * Return it as 'Uint8Array' of the stdout until EOF
12061847f8eSopenharmony_ci     *
12161847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Return subprocess standard output.
12261847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
12361847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
12461847f8eSopenharmony_ci     * @since 7
12561847f8eSopenharmony_ci     * @test
12661847f8eSopenharmony_ci     */
12761847f8eSopenharmony_ci    getOutput(): Promise<Uint8Array>;
12861847f8eSopenharmony_ci
12961847f8eSopenharmony_ci    /**
13061847f8eSopenharmony_ci     * Return it as 'Uint8Array of the stderr until EOF
13161847f8eSopenharmony_ci     *
13261847f8eSopenharmony_ci     * @returns { Promise<Uint8Array> } Return subprocess standard error output.
13361847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
13461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
13561847f8eSopenharmony_ci     * @since 7
13661847f8eSopenharmony_ci     * @test
13761847f8eSopenharmony_ci     */
13861847f8eSopenharmony_ci    getErrorOutput(): Promise<Uint8Array>;
13961847f8eSopenharmony_ci
14061847f8eSopenharmony_ci    /**
14161847f8eSopenharmony_ci     * Close the target process
14261847f8eSopenharmony_ci     *
14361847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
14461847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
14561847f8eSopenharmony_ci     * @since 7
14661847f8eSopenharmony_ci     * @test
14761847f8eSopenharmony_ci     */
14861847f8eSopenharmony_ci    close(): void;
14961847f8eSopenharmony_ci
15061847f8eSopenharmony_ci    /**
15161847f8eSopenharmony_ci     * Send a signal to process
15261847f8eSopenharmony_ci     *
15361847f8eSopenharmony_ci     * @param { number | string } signal - Number or string represents the signal sent.
15461847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
15561847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
15661847f8eSopenharmony_ci     * @since 7
15761847f8eSopenharmony_ci     * @test
15861847f8eSopenharmony_ci     */
15961847f8eSopenharmony_ci    kill(signal: number | string): void;
16061847f8eSopenharmony_ci  }
16161847f8eSopenharmony_ci
16261847f8eSopenharmony_ci  /**
16361847f8eSopenharmony_ci   * Process is mainly used to obtain the relevant ID of the process, obtain and modify the
16461847f8eSopenharmony_ci   * working directory of the process, exit and close the process.
16561847f8eSopenharmony_ci   *
16661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
16761847f8eSopenharmony_ci   * @since 9
16861847f8eSopenharmony_ci   * @name ProcessManager
16961847f8eSopenharmony_ci   */
17061847f8eSopenharmony_ci  /**
17161847f8eSopenharmony_ci   * Process is mainly used to obtain the relevant ID of the process, obtain and modify the
17261847f8eSopenharmony_ci   * working directory of the process, exit and close the process.
17361847f8eSopenharmony_ci   *
17461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
17561847f8eSopenharmony_ci   * @crossplatform
17661847f8eSopenharmony_ci   * @since 10
17761847f8eSopenharmony_ci   * @name ProcessManager
17861847f8eSopenharmony_ci   */
17961847f8eSopenharmony_ci  /**
18061847f8eSopenharmony_ci   * Process is mainly used to obtain the relevant ID of the process, obtain and modify the
18161847f8eSopenharmony_ci   * working directory of the process, exit and close the process.
18261847f8eSopenharmony_ci   *
18361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
18461847f8eSopenharmony_ci   * @crossplatform
18561847f8eSopenharmony_ci   * @atomicservice
18661847f8eSopenharmony_ci   * @since 11
18761847f8eSopenharmony_ci   * @name ProcessManager
18861847f8eSopenharmony_ci   */
18961847f8eSopenharmony_ci  export class ProcessManager {
19061847f8eSopenharmony_ci    /**
19161847f8eSopenharmony_ci     * Returns a boolean whether the specified uid belongs to a particular application.
19261847f8eSopenharmony_ci     *
19361847f8eSopenharmony_ci     * @param { number } v - An id.
19461847f8eSopenharmony_ci     * @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
19561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
19661847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
19761847f8eSopenharmony_ci     * 2.Incorrect parameter types.
19861847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
19961847f8eSopenharmony_ci     * @since 9
20061847f8eSopenharmony_ci     */
20161847f8eSopenharmony_ci    /**
20261847f8eSopenharmony_ci     * Returns a boolean whether the specified uid belongs to a particular application.
20361847f8eSopenharmony_ci     *
20461847f8eSopenharmony_ci     * @param { number } v - An id.
20561847f8eSopenharmony_ci     * @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
20661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
20761847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
20861847f8eSopenharmony_ci     * 2.Incorrect parameter types.
20961847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
21061847f8eSopenharmony_ci     * @crossplatform
21161847f8eSopenharmony_ci     * @since 10
21261847f8eSopenharmony_ci     */
21361847f8eSopenharmony_ci    /**
21461847f8eSopenharmony_ci     * Returns a boolean whether the specified uid belongs to a particular application.
21561847f8eSopenharmony_ci     *
21661847f8eSopenharmony_ci     * @param { number } v - An id.
21761847f8eSopenharmony_ci     * @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
21861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
21961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
22061847f8eSopenharmony_ci     * 2.Incorrect parameter types.
22161847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
22261847f8eSopenharmony_ci     * @crossplatform
22361847f8eSopenharmony_ci     * @atomicservice
22461847f8eSopenharmony_ci     * @since 11
22561847f8eSopenharmony_ci     */
22661847f8eSopenharmony_ci    isAppUid(v: number): boolean;
22761847f8eSopenharmony_ci
22861847f8eSopenharmony_ci    /**
22961847f8eSopenharmony_ci     * Returns the uid based on the specified user name.
23061847f8eSopenharmony_ci     *
23161847f8eSopenharmony_ci     * @param { string } v - Process name.
23261847f8eSopenharmony_ci     * @returns { number } Return the uid based on the specified user name.
23361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
23461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
23561847f8eSopenharmony_ci     * 2.Incorrect parameter types.
23661847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
23761847f8eSopenharmony_ci     * @since 9
23861847f8eSopenharmony_ci     */
23961847f8eSopenharmony_ci    /**
24061847f8eSopenharmony_ci     * Returns the uid based on the specified user name.
24161847f8eSopenharmony_ci     *
24261847f8eSopenharmony_ci     * @param { string } v - Process name.
24361847f8eSopenharmony_ci     * @returns { number } Return the uid based on the specified user name.
24461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
24561847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
24661847f8eSopenharmony_ci     * 2.Incorrect parameter types.
24761847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
24861847f8eSopenharmony_ci     * @crossplatform
24961847f8eSopenharmony_ci     * @since 10
25061847f8eSopenharmony_ci     */
25161847f8eSopenharmony_ci    /**
25261847f8eSopenharmony_ci     * Returns the uid based on the specified user name.
25361847f8eSopenharmony_ci     *
25461847f8eSopenharmony_ci     * @param { string } v - Process name.
25561847f8eSopenharmony_ci     * @returns { number } Return the uid based on the specified user name.
25661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
25761847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
25861847f8eSopenharmony_ci     * 2.Incorrect parameter types.
25961847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
26061847f8eSopenharmony_ci     * @crossplatform
26161847f8eSopenharmony_ci     * @atomicservice
26261847f8eSopenharmony_ci     * @since 11
26361847f8eSopenharmony_ci     */
26461847f8eSopenharmony_ci    getUidForName(v: string): number;
26561847f8eSopenharmony_ci
26661847f8eSopenharmony_ci    /**
26761847f8eSopenharmony_ci     * Returns the thread priority based on the specified tid.
26861847f8eSopenharmony_ci     *
26961847f8eSopenharmony_ci     * @param { number } v - The tid of the process.
27061847f8eSopenharmony_ci     * @returns { number } Return the thread priority based on the specified tid.
27161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
27261847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
27361847f8eSopenharmony_ci     * 2.Incorrect parameter types.
27461847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
27561847f8eSopenharmony_ci     * @since 9
27661847f8eSopenharmony_ci     */
27761847f8eSopenharmony_ci    /**
27861847f8eSopenharmony_ci     * Returns the thread priority based on the specified tid.
27961847f8eSopenharmony_ci     *
28061847f8eSopenharmony_ci     * @param { number } v - The tid of the process.
28161847f8eSopenharmony_ci     * @returns { number } Return the thread priority based on the specified tid.
28261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
28361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
28461847f8eSopenharmony_ci     * 2.Incorrect parameter types.
28561847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
28661847f8eSopenharmony_ci     * @crossplatform
28761847f8eSopenharmony_ci     * @since 10
28861847f8eSopenharmony_ci     */
28961847f8eSopenharmony_ci    /**
29061847f8eSopenharmony_ci     * Returns the thread priority based on the specified tid.
29161847f8eSopenharmony_ci     *
29261847f8eSopenharmony_ci     * @param { number } v - The tid of the process.
29361847f8eSopenharmony_ci     * @returns { number } Return the thread priority based on the specified tid.
29461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
29561847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
29661847f8eSopenharmony_ci     * 2.Incorrect parameter types.
29761847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
29861847f8eSopenharmony_ci     * @crossplatform
29961847f8eSopenharmony_ci     * @atomicservice
30061847f8eSopenharmony_ci     * @since 11
30161847f8eSopenharmony_ci     */
30261847f8eSopenharmony_ci    getThreadPriority(v: number): number;
30361847f8eSopenharmony_ci
30461847f8eSopenharmony_ci    /**
30561847f8eSopenharmony_ci     * Returns the system configuration at runtime.
30661847f8eSopenharmony_ci     *
30761847f8eSopenharmony_ci     * @param { number } name - Parameters defined by the system configuration.
30861847f8eSopenharmony_ci     * @returns { number } Return the system configuration at runtime.
30961847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
31061847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
31161847f8eSopenharmony_ci     * 2.Incorrect parameter types.
31261847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
31361847f8eSopenharmony_ci     * @since 9
31461847f8eSopenharmony_ci     */
31561847f8eSopenharmony_ci    /**
31661847f8eSopenharmony_ci     * Returns the system configuration at runtime.
31761847f8eSopenharmony_ci     *
31861847f8eSopenharmony_ci     * @param { number } name - Parameters defined by the system configuration.
31961847f8eSopenharmony_ci     * @returns { number } Return the system configuration at runtime.
32061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
32161847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
32261847f8eSopenharmony_ci     * 2.Incorrect parameter types.
32361847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
32461847f8eSopenharmony_ci     * @crossplatform
32561847f8eSopenharmony_ci     * @since 10
32661847f8eSopenharmony_ci     */
32761847f8eSopenharmony_ci    /**
32861847f8eSopenharmony_ci     * Returns the system configuration at runtime.
32961847f8eSopenharmony_ci     *
33061847f8eSopenharmony_ci     * @param { number } name - Parameters defined by the system configuration.
33161847f8eSopenharmony_ci     * @returns { number } Return the system configuration at runtime.
33261847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
33361847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
33461847f8eSopenharmony_ci     * 2.Incorrect parameter types.
33561847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
33661847f8eSopenharmony_ci     * @crossplatform
33761847f8eSopenharmony_ci     * @atomicservice
33861847f8eSopenharmony_ci     * @since 11
33961847f8eSopenharmony_ci     */
34061847f8eSopenharmony_ci    getSystemConfig(name: number): number;
34161847f8eSopenharmony_ci
34261847f8eSopenharmony_ci    /**
34361847f8eSopenharmony_ci     * Returns the system value for environment variables.
34461847f8eSopenharmony_ci     *
34561847f8eSopenharmony_ci     * @param { string } name - Parameters defined by the system environment variables.
34661847f8eSopenharmony_ci     * @returns { string } Return the system value for environment variables.
34761847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
34861847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
34961847f8eSopenharmony_ci     * 2.Incorrect parameter types.
35061847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
35161847f8eSopenharmony_ci     * @since 9
35261847f8eSopenharmony_ci     */
35361847f8eSopenharmony_ci    /**
35461847f8eSopenharmony_ci     * Returns the system value for environment variables.
35561847f8eSopenharmony_ci     *
35661847f8eSopenharmony_ci     * @param { string } name - Parameters defined by the system environment variables.
35761847f8eSopenharmony_ci     * @returns { string } Return the system value for environment variables.
35861847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
35961847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
36061847f8eSopenharmony_ci     * 2.Incorrect parameter types.
36161847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
36261847f8eSopenharmony_ci     * @crossplatform
36361847f8eSopenharmony_ci     * @since 10
36461847f8eSopenharmony_ci     */
36561847f8eSopenharmony_ci    /**
36661847f8eSopenharmony_ci     * Returns the system value for environment variables.
36761847f8eSopenharmony_ci     *
36861847f8eSopenharmony_ci     * @param { string } name - Parameters defined by the system environment variables.
36961847f8eSopenharmony_ci     * @returns { string } Return the system value for environment variables.
37061847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
37161847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
37261847f8eSopenharmony_ci     * 2.Incorrect parameter types.
37361847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
37461847f8eSopenharmony_ci     * @crossplatform
37561847f8eSopenharmony_ci     * @atomicservice
37661847f8eSopenharmony_ci     * @since 11
37761847f8eSopenharmony_ci     */
37861847f8eSopenharmony_ci    getEnvironmentVar(name: string): string;
37961847f8eSopenharmony_ci
38061847f8eSopenharmony_ci    /**
38161847f8eSopenharmony_ci     * Process exit
38261847f8eSopenharmony_ci     *
38361847f8eSopenharmony_ci     * @param { number } code - Process exit code.
38461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
38561847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
38661847f8eSopenharmony_ci     * 2.Incorrect parameter types.
38761847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
38861847f8eSopenharmony_ci     * @since 9
38961847f8eSopenharmony_ci     */
39061847f8eSopenharmony_ci    /**
39161847f8eSopenharmony_ci     * Process exit
39261847f8eSopenharmony_ci     *
39361847f8eSopenharmony_ci     * @param { number } code - Process exit code.
39461847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
39561847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
39661847f8eSopenharmony_ci     * 2.Incorrect parameter types.
39761847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
39861847f8eSopenharmony_ci     * @crossplatform
39961847f8eSopenharmony_ci     * @since 10
40061847f8eSopenharmony_ci     */
40161847f8eSopenharmony_ci    /**
40261847f8eSopenharmony_ci     * Process exit
40361847f8eSopenharmony_ci     *
40461847f8eSopenharmony_ci     * @param { number } code - Process exit code.
40561847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
40661847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
40761847f8eSopenharmony_ci     * 2.Incorrect parameter types.
40861847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
40961847f8eSopenharmony_ci     * @crossplatform
41061847f8eSopenharmony_ci     * @atomicservice
41161847f8eSopenharmony_ci     * @since 11
41261847f8eSopenharmony_ci     */
41361847f8eSopenharmony_ci    exit(code: number): void;
41461847f8eSopenharmony_ci
41561847f8eSopenharmony_ci    /**
41661847f8eSopenharmony_ci     * Return whether the signal was sent successfully
41761847f8eSopenharmony_ci     *
41861847f8eSopenharmony_ci     * @param { number } signal - Signal sent.
41961847f8eSopenharmony_ci     * @param { number } pid - Send signal to target pid.
42061847f8eSopenharmony_ci     * @returns { boolean } Return the result of the signal.
42161847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
42261847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
42361847f8eSopenharmony_ci     * 2.Incorrect parameter types.
42461847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
42561847f8eSopenharmony_ci     * @since 9
42661847f8eSopenharmony_ci     */
42761847f8eSopenharmony_ci    /**
42861847f8eSopenharmony_ci     * Return whether the signal was sent successfully
42961847f8eSopenharmony_ci     *
43061847f8eSopenharmony_ci     * @param { number } signal - Signal sent.
43161847f8eSopenharmony_ci     * @param { number } pid - Send signal to target pid.
43261847f8eSopenharmony_ci     * @returns { boolean } Return the result of the signal.
43361847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
43461847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
43561847f8eSopenharmony_ci     * 2.Incorrect parameter types.
43661847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
43761847f8eSopenharmony_ci     * @crossplatform
43861847f8eSopenharmony_ci     * @since 10
43961847f8eSopenharmony_ci     */
44061847f8eSopenharmony_ci    /**
44161847f8eSopenharmony_ci     * Return whether the signal was sent successfully
44261847f8eSopenharmony_ci     *
44361847f8eSopenharmony_ci     * @param { number } signal - Signal sent.
44461847f8eSopenharmony_ci     * @param { number } pid - Send signal to target pid.
44561847f8eSopenharmony_ci     * @returns { boolean } Return the result of the signal.
44661847f8eSopenharmony_ci     * @throws { BusinessError } 401 - Parameter error. Possible causes:
44761847f8eSopenharmony_ci     * 1.Mandatory parameters are left unspecified;
44861847f8eSopenharmony_ci     * 2.Incorrect parameter types.
44961847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
45061847f8eSopenharmony_ci     * @crossplatform
45161847f8eSopenharmony_ci     * @atomicservice
45261847f8eSopenharmony_ci     * @since 11
45361847f8eSopenharmony_ci     */
45461847f8eSopenharmony_ci    kill(signal: number, pid: number): boolean;
45561847f8eSopenharmony_ci  }
45661847f8eSopenharmony_ci
45761847f8eSopenharmony_ci  /**
45861847f8eSopenharmony_ci   * Returns the numeric valid group ID of the process
45961847f8eSopenharmony_ci   *
46061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
46161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
46261847f8eSopenharmony_ci   * @since 7
46361847f8eSopenharmony_ci   * @test
46461847f8eSopenharmony_ci   */
46561847f8eSopenharmony_ci  const egid: number;
46661847f8eSopenharmony_ci
46761847f8eSopenharmony_ci  /**
46861847f8eSopenharmony_ci   * Return the numeric valid user identity of the process
46961847f8eSopenharmony_ci   *
47061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
47161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
47261847f8eSopenharmony_ci   * @since 7
47361847f8eSopenharmony_ci   * @test
47461847f8eSopenharmony_ci   */
47561847f8eSopenharmony_ci  const euid: number;
47661847f8eSopenharmony_ci
47761847f8eSopenharmony_ci  /**
47861847f8eSopenharmony_ci   * Returns the numeric group id of the process
47961847f8eSopenharmony_ci   *
48061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
48161847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
48261847f8eSopenharmony_ci   * @since 7
48361847f8eSopenharmony_ci   * @test
48461847f8eSopenharmony_ci   */
48561847f8eSopenharmony_ci  const gid: number;
48661847f8eSopenharmony_ci
48761847f8eSopenharmony_ci  /**
48861847f8eSopenharmony_ci   * Returns the digital user id of the process
48961847f8eSopenharmony_ci   *
49061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
49161847f8eSopenharmony_ci   * @since 7
49261847f8eSopenharmony_ci   */
49361847f8eSopenharmony_ci  /**
49461847f8eSopenharmony_ci   * Returns the digital user id of the process
49561847f8eSopenharmony_ci   *
49661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
49761847f8eSopenharmony_ci   * @crossplatform
49861847f8eSopenharmony_ci   * @since 10
49961847f8eSopenharmony_ci   */
50061847f8eSopenharmony_ci  /**
50161847f8eSopenharmony_ci   * Returns the digital user id of the process
50261847f8eSopenharmony_ci   *
50361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
50461847f8eSopenharmony_ci   * @crossplatform
50561847f8eSopenharmony_ci   * @atomicservice
50661847f8eSopenharmony_ci   * @since 11
50761847f8eSopenharmony_ci   */
50861847f8eSopenharmony_ci  const uid: number;
50961847f8eSopenharmony_ci
51061847f8eSopenharmony_ci  /**
51161847f8eSopenharmony_ci   * Return an array with supplementary group id
51261847f8eSopenharmony_ci   *
51361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
51461847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
51561847f8eSopenharmony_ci   * @since 7
51661847f8eSopenharmony_ci   * @test
51761847f8eSopenharmony_ci   */
51861847f8eSopenharmony_ci  const groups: number[];
51961847f8eSopenharmony_ci
52061847f8eSopenharmony_ci  /**
52161847f8eSopenharmony_ci   * Return pid is The pid of the current process
52261847f8eSopenharmony_ci   *
52361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
52461847f8eSopenharmony_ci   * @since 7
52561847f8eSopenharmony_ci   */
52661847f8eSopenharmony_ci  /**
52761847f8eSopenharmony_ci   * Return pid is The pid of the current process
52861847f8eSopenharmony_ci   *
52961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
53061847f8eSopenharmony_ci   * @crossplatform
53161847f8eSopenharmony_ci   * @since 10
53261847f8eSopenharmony_ci   */
53361847f8eSopenharmony_ci  /**
53461847f8eSopenharmony_ci   * Return pid is The pid of the current process
53561847f8eSopenharmony_ci   *
53661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
53761847f8eSopenharmony_ci   * @crossplatform
53861847f8eSopenharmony_ci   * @atomicservice
53961847f8eSopenharmony_ci   * @since 11
54061847f8eSopenharmony_ci   */
54161847f8eSopenharmony_ci  const pid: number;
54261847f8eSopenharmony_ci
54361847f8eSopenharmony_ci  /**
54461847f8eSopenharmony_ci   * Return ppid is The pid of the current child process
54561847f8eSopenharmony_ci   *
54661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
54761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
54861847f8eSopenharmony_ci   * @since 7
54961847f8eSopenharmony_ci   * @test
55061847f8eSopenharmony_ci   */
55161847f8eSopenharmony_ci  const ppid: number;
55261847f8eSopenharmony_ci
55361847f8eSopenharmony_ci  /**
55461847f8eSopenharmony_ci   * Returns the tid of the current thread.
55561847f8eSopenharmony_ci   *
55661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
55761847f8eSopenharmony_ci   * @since 8
55861847f8eSopenharmony_ci   */
55961847f8eSopenharmony_ci  /**
56061847f8eSopenharmony_ci   * Returns the tid of the current thread.
56161847f8eSopenharmony_ci   *
56261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
56361847f8eSopenharmony_ci   * @crossplatform
56461847f8eSopenharmony_ci   * @since 10
56561847f8eSopenharmony_ci   */
56661847f8eSopenharmony_ci  /**
56761847f8eSopenharmony_ci   * Returns the tid of the current thread.
56861847f8eSopenharmony_ci   *
56961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
57061847f8eSopenharmony_ci   * @crossplatform
57161847f8eSopenharmony_ci   * @atomicservice
57261847f8eSopenharmony_ci   * @since 11
57361847f8eSopenharmony_ci   */
57461847f8eSopenharmony_ci  const tid: number;
57561847f8eSopenharmony_ci
57661847f8eSopenharmony_ci  /**
57761847f8eSopenharmony_ci   * Returns a boolean whether the process is isolated.
57861847f8eSopenharmony_ci   *
57961847f8eSopenharmony_ci   * @returns { boolean } Return boolean whether the process is isolated.
58061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
58161847f8eSopenharmony_ci   * @since 8
58261847f8eSopenharmony_ci   */
58361847f8eSopenharmony_ci  /**
58461847f8eSopenharmony_ci   * Returns a boolean whether the process is isolated.
58561847f8eSopenharmony_ci   *
58661847f8eSopenharmony_ci   * @returns { boolean } Return boolean whether the process is isolated.
58761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
58861847f8eSopenharmony_ci   * @atomicservice
58961847f8eSopenharmony_ci   * @since 11
59061847f8eSopenharmony_ci   */
59161847f8eSopenharmony_ci  function isIsolatedProcess(): boolean;
59261847f8eSopenharmony_ci
59361847f8eSopenharmony_ci  /**
59461847f8eSopenharmony_ci   * Returns a boolean whether the specified uid belongs to a particular application.
59561847f8eSopenharmony_ci   *
59661847f8eSopenharmony_ci   * @param { number } v - An id.
59761847f8eSopenharmony_ci   * @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
59861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
59961847f8eSopenharmony_ci   * @since 8
60061847f8eSopenharmony_ci   * @deprecated since 9
60161847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.isAppUid
60261847f8eSopenharmony_ci   */
60361847f8eSopenharmony_ci  function isAppUid(v: number): boolean;
60461847f8eSopenharmony_ci
60561847f8eSopenharmony_ci  /**
60661847f8eSopenharmony_ci   * Returns a boolean whether the process is running in a 64-bit environment.
60761847f8eSopenharmony_ci   *
60861847f8eSopenharmony_ci   * @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
60961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
61061847f8eSopenharmony_ci   * @since 8
61161847f8eSopenharmony_ci   */
61261847f8eSopenharmony_ci  /**
61361847f8eSopenharmony_ci   * Returns a boolean whether the process is running in a 64-bit environment.
61461847f8eSopenharmony_ci   *
61561847f8eSopenharmony_ci   * @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
61661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
61761847f8eSopenharmony_ci   * @crossplatform
61861847f8eSopenharmony_ci   * @since 10
61961847f8eSopenharmony_ci   */
62061847f8eSopenharmony_ci  /**
62161847f8eSopenharmony_ci   * Returns a boolean whether the process is running in a 64-bit environment.
62261847f8eSopenharmony_ci   *
62361847f8eSopenharmony_ci   * @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
62461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
62561847f8eSopenharmony_ci   * @crossplatform
62661847f8eSopenharmony_ci   * @atomicservice
62761847f8eSopenharmony_ci   * @since 11
62861847f8eSopenharmony_ci   */
62961847f8eSopenharmony_ci  function is64Bit(): boolean;
63061847f8eSopenharmony_ci
63161847f8eSopenharmony_ci  /**
63261847f8eSopenharmony_ci   * Returns the uid based on the specified user name.
63361847f8eSopenharmony_ci   *
63461847f8eSopenharmony_ci   * @param { string } v - Process name.
63561847f8eSopenharmony_ci   * @returns { number } Return the uid based on the specified user name.
63661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
63761847f8eSopenharmony_ci   * @since 8
63861847f8eSopenharmony_ci   * @deprecated since 9
63961847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.getUidForName
64061847f8eSopenharmony_ci   */
64161847f8eSopenharmony_ci  function getUidForName(v: string): number;
64261847f8eSopenharmony_ci
64361847f8eSopenharmony_ci  /**
64461847f8eSopenharmony_ci   * Returns the thread priority based on the specified tid.
64561847f8eSopenharmony_ci   *
64661847f8eSopenharmony_ci   * @param { number } v - The tid of the process.
64761847f8eSopenharmony_ci   * @returns { number } Return the thread priority based on the specified tid.
64861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
64961847f8eSopenharmony_ci   * @since 8
65061847f8eSopenharmony_ci   * @deprecated since 9
65161847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.getThreadPriority
65261847f8eSopenharmony_ci   */
65361847f8eSopenharmony_ci  function getThreadPriority(v: number): number;
65461847f8eSopenharmony_ci
65561847f8eSopenharmony_ci  /**
65661847f8eSopenharmony_ci   * Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
65761847f8eSopenharmony_ci   *
65861847f8eSopenharmony_ci   * @returns { number } Return the start of the system to the start of the process.
65961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
66061847f8eSopenharmony_ci   * @since 8
66161847f8eSopenharmony_ci   */
66261847f8eSopenharmony_ci  /**
66361847f8eSopenharmony_ci   * Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
66461847f8eSopenharmony_ci   *
66561847f8eSopenharmony_ci   * @returns { number } Return the start of the system to the start of the process.
66661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
66761847f8eSopenharmony_ci   * @crossplatform
66861847f8eSopenharmony_ci   * @since 10
66961847f8eSopenharmony_ci   */
67061847f8eSopenharmony_ci  /**
67161847f8eSopenharmony_ci   * Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
67261847f8eSopenharmony_ci   *
67361847f8eSopenharmony_ci   * @returns { number } Return the start of the system to the start of the process.
67461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
67561847f8eSopenharmony_ci   * @crossplatform
67661847f8eSopenharmony_ci   * @atomicservice
67761847f8eSopenharmony_ci   * @since 11
67861847f8eSopenharmony_ci   */
67961847f8eSopenharmony_ci  function getStartRealtime(): number;
68061847f8eSopenharmony_ci
68161847f8eSopenharmony_ci  /**
68261847f8eSopenharmony_ci   * Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
68361847f8eSopenharmony_ci   *
68461847f8eSopenharmony_ci   * @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
68561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
68661847f8eSopenharmony_ci   * @since 8
68761847f8eSopenharmony_ci   */
68861847f8eSopenharmony_ci  /**
68961847f8eSopenharmony_ci   * Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
69061847f8eSopenharmony_ci   *
69161847f8eSopenharmony_ci   * @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
69261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
69361847f8eSopenharmony_ci   * @crossplatform
69461847f8eSopenharmony_ci   * @since 10
69561847f8eSopenharmony_ci   */
69661847f8eSopenharmony_ci  /**
69761847f8eSopenharmony_ci   * Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
69861847f8eSopenharmony_ci   *
69961847f8eSopenharmony_ci   * @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
70061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
70161847f8eSopenharmony_ci   * @crossplatform
70261847f8eSopenharmony_ci   * @atomicservice
70361847f8eSopenharmony_ci   * @since 11
70461847f8eSopenharmony_ci   */
70561847f8eSopenharmony_ci  function getPastCpuTime(): number;
70661847f8eSopenharmony_ci
70761847f8eSopenharmony_ci  /**
70861847f8eSopenharmony_ci   * Returns the system configuration at runtime.
70961847f8eSopenharmony_ci   *
71061847f8eSopenharmony_ci   * @param { number } name - Parameters defined by the system configuration.
71161847f8eSopenharmony_ci   * @returns { number } Return the system configuration at runtime.
71261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
71361847f8eSopenharmony_ci   * @since 8
71461847f8eSopenharmony_ci   * @deprecated since 9
71561847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.getSystemConfig
71661847f8eSopenharmony_ci   */
71761847f8eSopenharmony_ci  function getSystemConfig(name: number): number;
71861847f8eSopenharmony_ci
71961847f8eSopenharmony_ci  /**
72061847f8eSopenharmony_ci   * Returns the system value for environment variables.
72161847f8eSopenharmony_ci   *
72261847f8eSopenharmony_ci   * @param { string } name - Parameters defined by the system environment variables.
72361847f8eSopenharmony_ci   * @returns { string } Return the system value for environment variables.
72461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
72561847f8eSopenharmony_ci   * @since 8
72661847f8eSopenharmony_ci   * @deprecated since 9
72761847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.getEnvironmentVar
72861847f8eSopenharmony_ci   */
72961847f8eSopenharmony_ci  function getEnvironmentVar(name: string): string;
73061847f8eSopenharmony_ci  
73161847f8eSopenharmony_ci  /**
73261847f8eSopenharmony_ci   * User Stored Events
73361847f8eSopenharmony_ci   *
73461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
73561847f8eSopenharmony_ci   * @since 7
73661847f8eSopenharmony_ci   */
73761847f8eSopenharmony_ci  /**
73861847f8eSopenharmony_ci   * User Stored Events
73961847f8eSopenharmony_ci   *
74061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
74161847f8eSopenharmony_ci   * @crossplatform
74261847f8eSopenharmony_ci   * @since 10
74361847f8eSopenharmony_ci   */
74461847f8eSopenharmony_ci  /**
74561847f8eSopenharmony_ci   * User Stored Events
74661847f8eSopenharmony_ci   *
74761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
74861847f8eSopenharmony_ci   * @crossplatform
74961847f8eSopenharmony_ci   * @atomicservice
75061847f8eSopenharmony_ci   * @since 11
75161847f8eSopenharmony_ci   */
75261847f8eSopenharmony_ci  /**
75361847f8eSopenharmony_ci   * User Stored Events
75461847f8eSopenharmony_ci   *
75561847f8eSopenharmony_ci   * @typedef { function } EventListener
75661847f8eSopenharmony_ci   * @param { Object } evt - User events
75761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
75861847f8eSopenharmony_ci   * @crossplatform
75961847f8eSopenharmony_ci   * @atomicservice
76061847f8eSopenharmony_ci   * @since 12
76161847f8eSopenharmony_ci   */
76261847f8eSopenharmony_ci  type EventListener = (evt: Object) => void;
76361847f8eSopenharmony_ci  
76461847f8eSopenharmony_ci  /**
76561847f8eSopenharmony_ci   * Provides the ConditionType type,including timeout, killSignal, maxBuffer.
76661847f8eSopenharmony_ci   *
76761847f8eSopenharmony_ci   * @typedef ConditionType
76861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
76961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
77061847f8eSopenharmony_ci   * @since 10
77161847f8eSopenharmony_ci   * @test
77261847f8eSopenharmony_ci   */
77361847f8eSopenharmony_ci  interface ConditionType {
77461847f8eSopenharmony_ci	  
77561847f8eSopenharmony_ci    /**
77661847f8eSopenharmony_ci     * Maximum running time (in ms) of the child process.
77761847f8eSopenharmony_ci     *
77861847f8eSopenharmony_ci     * @type { ?number }
77961847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
78061847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
78161847f8eSopenharmony_ci     * @since 10
78261847f8eSopenharmony_ci     * @test
78361847f8eSopenharmony_ci     */
78461847f8eSopenharmony_ci    timeout?: number;
78561847f8eSopenharmony_ci	  
78661847f8eSopenharmony_ci    /**
78761847f8eSopenharmony_ci     * Signal sent to the child process when the running time of a child process exceeds the timeout period.
78861847f8eSopenharmony_ci     *
78961847f8eSopenharmony_ci     * @type { ?(number | string) }
79061847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
79161847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
79261847f8eSopenharmony_ci     * @since 10
79361847f8eSopenharmony_ci     * @test
79461847f8eSopenharmony_ci     */
79561847f8eSopenharmony_ci    killSignal?: number | string;
79661847f8eSopenharmony_ci	  
79761847f8eSopenharmony_ci    /**
79861847f8eSopenharmony_ci     * Maximum buffer size for the standard input and output of the child process.
79961847f8eSopenharmony_ci     *
80061847f8eSopenharmony_ci     * @type { ?number }
80161847f8eSopenharmony_ci     * @syscap SystemCapability.Utils.Lang
80261847f8eSopenharmony_ci     * @systemapi Hide this for inner system use
80361847f8eSopenharmony_ci     * @since 10
80461847f8eSopenharmony_ci     * @test
80561847f8eSopenharmony_ci     */
80661847f8eSopenharmony_ci    maxBuffer?: number;
80761847f8eSopenharmony_ci  }
80861847f8eSopenharmony_ci  /**
80961847f8eSopenharmony_ci   * Returns a child process object and spawns a new ChildProcess to run the command.
81061847f8eSopenharmony_ci   *
81161847f8eSopenharmony_ci   * @param { string } command - String of the shell commands executed by the child process.
81261847f8eSopenharmony_ci   * @param { ConditionType } options - This is an object. The object contains three parameters. Timeout is the running time of the child
81361847f8eSopenharmony_ci   * process, killSignal is the signal sent when the child process reaches timeout, and maxBuffer is the size of the
81461847f8eSopenharmony_ci   * maximum buffer area for standard input and output.
81561847f8eSopenharmony_ci   * @returns { ChildProcess } Returns a child process object.
81661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
81761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
81861847f8eSopenharmony_ci   * @since 7
81961847f8eSopenharmony_ci   * @test
82061847f8eSopenharmony_ci   */
82161847f8eSopenharmony_ci  function runCmd(
82261847f8eSopenharmony_ci    command: string,
82361847f8eSopenharmony_ci    options?: ConditionType
82461847f8eSopenharmony_ci  ): ChildProcess;
82561847f8eSopenharmony_ci
82661847f8eSopenharmony_ci  /**
82761847f8eSopenharmony_ci   * Abort current process
82861847f8eSopenharmony_ci   *
82961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
83061847f8eSopenharmony_ci   * @since 7
83161847f8eSopenharmony_ci   */
83261847f8eSopenharmony_ci  /**
83361847f8eSopenharmony_ci   * Abort current process
83461847f8eSopenharmony_ci   *
83561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
83661847f8eSopenharmony_ci   * @crossplatform
83761847f8eSopenharmony_ci   * @since 10
83861847f8eSopenharmony_ci   */
83961847f8eSopenharmony_ci  /**
84061847f8eSopenharmony_ci   * Abort current process
84161847f8eSopenharmony_ci   *
84261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
84361847f8eSopenharmony_ci   * @crossplatform
84461847f8eSopenharmony_ci   * @atomicservice
84561847f8eSopenharmony_ci   * @since 11
84661847f8eSopenharmony_ci   */
84761847f8eSopenharmony_ci  function abort(): void;
84861847f8eSopenharmony_ci
84961847f8eSopenharmony_ci  /**
85061847f8eSopenharmony_ci   * Register for an event
85161847f8eSopenharmony_ci   *
85261847f8eSopenharmony_ci   * @param { string } type - Indicates the type of event registered.
85361847f8eSopenharmony_ci   * @param { EventListener } listener - Represents the registered event function
85461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
85561847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
85661847f8eSopenharmony_ci   * @since 7
85761847f8eSopenharmony_ci   * @test
85861847f8eSopenharmony_ci   */
85961847f8eSopenharmony_ci  function on(type: string, listener: EventListener): void;
86061847f8eSopenharmony_ci
86161847f8eSopenharmony_ci  /**
86261847f8eSopenharmony_ci   * Remove registered event
86361847f8eSopenharmony_ci   *
86461847f8eSopenharmony_ci   * @param { string } type - Remove the type of registered event.
86561847f8eSopenharmony_ci   * @returns { boolean } Return removed result.
86661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
86761847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
86861847f8eSopenharmony_ci   * @since 7
86961847f8eSopenharmony_ci   * @test
87061847f8eSopenharmony_ci   */
87161847f8eSopenharmony_ci  function off(type: string): boolean;
87261847f8eSopenharmony_ci
87361847f8eSopenharmony_ci  /**
87461847f8eSopenharmony_ci   * Process exit
87561847f8eSopenharmony_ci   *
87661847f8eSopenharmony_ci   * @param { number } code - Process exit code.
87761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
87861847f8eSopenharmony_ci   * @since 7
87961847f8eSopenharmony_ci   * @deprecated since 9
88061847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.exit
88161847f8eSopenharmony_ci   */
88261847f8eSopenharmony_ci  function exit(code: number): void;
88361847f8eSopenharmony_ci
88461847f8eSopenharmony_ci  /**
88561847f8eSopenharmony_ci   * Return the current work directory;
88661847f8eSopenharmony_ci   *
88761847f8eSopenharmony_ci   * @returns { string } Return the current work directory.
88861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
88961847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
89061847f8eSopenharmony_ci   * @since 7
89161847f8eSopenharmony_ci   * @test
89261847f8eSopenharmony_ci   */
89361847f8eSopenharmony_ci  function cwd(): string;
89461847f8eSopenharmony_ci
89561847f8eSopenharmony_ci  /**
89661847f8eSopenharmony_ci   * Change current directory
89761847f8eSopenharmony_ci   *
89861847f8eSopenharmony_ci   * @param { string } dir - The path you want to change.
89961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
90061847f8eSopenharmony_ci   * @systemapi Hide this for inner system use
90161847f8eSopenharmony_ci   * @since 7
90261847f8eSopenharmony_ci   * @test
90361847f8eSopenharmony_ci   */
90461847f8eSopenharmony_ci  function chdir(dir: string): void;
90561847f8eSopenharmony_ci
90661847f8eSopenharmony_ci  /**
90761847f8eSopenharmony_ci   * Returns the running time of the system
90861847f8eSopenharmony_ci   *
90961847f8eSopenharmony_ci   * @returns { number } Return the running time of the system.
91061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
91161847f8eSopenharmony_ci   * @since 7
91261847f8eSopenharmony_ci   */
91361847f8eSopenharmony_ci  /**
91461847f8eSopenharmony_ci   * Returns the running time of the system
91561847f8eSopenharmony_ci   *
91661847f8eSopenharmony_ci   * @returns { number } Return the running time of the system.
91761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
91861847f8eSopenharmony_ci   * @crossplatform
91961847f8eSopenharmony_ci   * @since 10
92061847f8eSopenharmony_ci   */
92161847f8eSopenharmony_ci  /**
92261847f8eSopenharmony_ci   * Returns the running time of the system
92361847f8eSopenharmony_ci   *
92461847f8eSopenharmony_ci   * @returns { number } Return the running time of the system.
92561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
92661847f8eSopenharmony_ci   * @crossplatform
92761847f8eSopenharmony_ci   * @atomicservice
92861847f8eSopenharmony_ci   * @since 11
92961847f8eSopenharmony_ci   */
93061847f8eSopenharmony_ci  function uptime(): number;
93161847f8eSopenharmony_ci
93261847f8eSopenharmony_ci  /**
93361847f8eSopenharmony_ci   * Return whether the signal was sent successfully
93461847f8eSopenharmony_ci   *
93561847f8eSopenharmony_ci   * @param { number } signal - Signal sent.
93661847f8eSopenharmony_ci   * @param { number } pid - Send signal to target pid.
93761847f8eSopenharmony_ci   * @returns { boolean } Return the result of the signal.
93861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
93961847f8eSopenharmony_ci   * @since 7
94061847f8eSopenharmony_ci   * @deprecated since 9
94161847f8eSopenharmony_ci   * @useinstead ohos.process.ProcessManager.kill
94261847f8eSopenharmony_ci   */
94361847f8eSopenharmony_ci  function kill(signal: number, pid: number): boolean;
94461847f8eSopenharmony_ci}
94561847f8eSopenharmony_ciexport default process;
946