1 Star 0 Fork 3.9K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.process.d.ts 28.32 KB
一键复制 编辑 原始数据 按行查看 历史
milkpotatoes 提交于 2024-08-11 16:23 +08:00 . Add missing type declaration for process
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkTS
*/
/**
* The process is mainly used to obtain the relevant ID of the process, obtain and modify
* the working directory of the process, exit and close the process.
*
* @namespace process
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* The process is mainly used to obtain the relevant ID of the process, obtain and modify
* the working directory of the process, exit and close the process.
*
* @namespace process
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* The process is mainly used to obtain the relevant ID of the process, obtain and modify
* the working directory of the process, exit and close the process.
*
* @namespace process
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
declare namespace process {
/**
* The childprocess object can be used to create a new process.
*
* @typedef ChildProcess
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
export interface ChildProcess {
/**
* Return pid is the pid of the current process
*
* @type { number }
* @readonly
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
readonly pid: number;
/**
* Return ppid is the pid of the current child process
*
* @type { number }
* @readonly
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
readonly ppid: number;
/**
* Return exitCode is the exit code of the current child process
*
* @type { number }
* @readonly
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
readonly exitCode: number;
/**
* Return boolean is whether the current process signal is sent successfully
*
* @type { boolean }
* @readonly
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
readonly killed: boolean;
/**
* Return 'number' is the target process exit code
*
* @returns { Promise<number> } Return the target process exit code.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
wait(): Promise<number>;
/**
* Return it as 'Uint8Array' of the stdout until EOF
*
* @returns { Promise<Uint8Array> } Return subprocess standard output.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
getOutput(): Promise<Uint8Array>;
/**
* Return it as 'Uint8Array of the stderr until EOF
*
* @returns { Promise<Uint8Array> } Return subprocess standard error output.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
getErrorOutput(): Promise<Uint8Array>;
/**
* Close the target process
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
close(): void;
/**
* Send a signal to process
*
* @param { number | string } signal - Number or string represents the signal sent.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
kill(signal: number | string): void;
}
/**
* Process is mainly used to obtain the relevant ID of the process, obtain and modify the
* working directory of the process, exit and close the process.
*
* @syscap SystemCapability.Utils.Lang
* @since 9
* @name ProcessManager
*/
/**
* Process is mainly used to obtain the relevant ID of the process, obtain and modify the
* working directory of the process, exit and close the process.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
* @name ProcessManager
*/
/**
* Process is mainly used to obtain the relevant ID of the process, obtain and modify the
* working directory of the process, exit and close the process.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
* @name ProcessManager
*/
export class ProcessManager {
/**
* Returns a boolean whether the specified uid belongs to a particular application.
*
* @param { number } v - An id.
* @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns a boolean whether the specified uid belongs to a particular application.
*
* @param { number } v - An id.
* @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns a boolean whether the specified uid belongs to a particular application.
*
* @param { number } v - An id.
* @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
isAppUid(v: number): boolean;
/**
* Returns the uid based on the specified user name.
*
* @param { string } v - Process name.
* @returns { number } Return the uid based on the specified user name.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the uid based on the specified user name.
*
* @param { string } v - Process name.
* @returns { number } Return the uid based on the specified user name.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the uid based on the specified user name.
*
* @param { string } v - Process name.
* @returns { number } Return the uid based on the specified user name.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
getUidForName(v: string): number;
/**
* Returns the thread priority based on the specified tid.
*
* @param { number } v - The tid of the process.
* @returns { number } Return the thread priority based on the specified tid.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the thread priority based on the specified tid.
*
* @param { number } v - The tid of the process.
* @returns { number } Return the thread priority based on the specified tid.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the thread priority based on the specified tid.
*
* @param { number } v - The tid of the process.
* @returns { number } Return the thread priority based on the specified tid.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
getThreadPriority(v: number): number;
/**
* Returns the system configuration at runtime.
*
* @param { number } name - Parameters defined by the system configuration.
* @returns { number } Return the system configuration at runtime.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the system configuration at runtime.
*
* @param { number } name - Parameters defined by the system configuration.
* @returns { number } Return the system configuration at runtime.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the system configuration at runtime.
*
* @param { number } name - Parameters defined by the system configuration.
* @returns { number } Return the system configuration at runtime.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
getSystemConfig(name: number): number;
/**
* Returns the system value for environment variables.
*
* @param { string } name - Parameters defined by the system environment variables.
* @returns { string } Return the system value for environment variables.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Returns the system value for environment variables.
*
* @param { string } name - Parameters defined by the system environment variables.
* @returns { string } Return the system value for environment variables.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the system value for environment variables.
*
* @param { string } name - Parameters defined by the system environment variables.
* @returns { string } Return the system value for environment variables.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
getEnvironmentVar(name: string): string;
/**
* Process exit
*
* @param { number } code - Process exit code.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Process exit
*
* @param { number } code - Process exit code.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Process exit
*
* @param { number } code - Process exit code.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
exit(code: number): void;
/**
* Return whether the signal was sent successfully
*
* @param { number } signal - Signal sent.
* @param { number } pid - Send signal to target pid.
* @returns { boolean } Return the result of the signal.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 9
*/
/**
* Return whether the signal was sent successfully
*
* @param { number } signal - Signal sent.
* @param { number } pid - Send signal to target pid.
* @returns { boolean } Return the result of the signal.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Return whether the signal was sent successfully
*
* @param { number } signal - Signal sent.
* @param { number } pid - Send signal to target pid.
* @returns { boolean } Return the result of the signal.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
kill(signal: number, pid: number): boolean;
}
/**
* Returns the numeric valid group ID of the process
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
const egid: number;
/**
* Return the numeric valid user identity of the process
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
const euid: number;
/**
* Returns the numeric group id of the process
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
const gid: number;
/**
* Returns the digital user id of the process
*
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* Returns the digital user id of the process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the digital user id of the process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
const uid: number;
/**
* Return an array with supplementary group id
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
const groups: number[];
/**
* Return pid is The pid of the current process
*
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* Return pid is The pid of the current process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Return pid is The pid of the current process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
const pid: number;
/**
* Return ppid is The pid of the current child process
*
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
const ppid: number;
/**
* Returns the tid of the current thread.
*
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the tid of the current thread.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the tid of the current thread.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
const tid: number;
/**
* Returns a boolean whether the process is isolated.
*
* @returns { boolean } Return boolean whether the process is isolated.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns a boolean whether the process is isolated.
*
* @returns { boolean } Return boolean whether the process is isolated.
* @syscap SystemCapability.Utils.Lang
* @atomicservice
* @since 11
*/
function isIsolatedProcess(): boolean;
/**
* Returns a boolean whether the specified uid belongs to a particular application.
*
* @param { number } v - An id.
* @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.isAppUid
*/
function isAppUid(v: number): boolean;
/**
* Returns a boolean whether the process is running in a 64-bit environment.
*
* @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns a boolean whether the process is running in a 64-bit environment.
*
* @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns a boolean whether the process is running in a 64-bit environment.
*
* @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function is64Bit(): boolean;
/**
* Returns the uid based on the specified user name.
*
* @param { string } v - Process name.
* @returns { number } Return the uid based on the specified user name.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.getUidForName
*/
function getUidForName(v: string): number;
/**
* Returns the thread priority based on the specified tid.
*
* @param { number } v - The tid of the process.
* @returns { number } Return the thread priority based on the specified tid.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.getThreadPriority
*/
function getThreadPriority(v: number): number;
/**
* Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
*
* @returns { number } Return the start of the system to the start of the process.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
*
* @returns { number } Return the start of the system to the start of the process.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
*
* @returns { number } Return the start of the system to the start of the process.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function getStartRealtime(): number;
/**
* Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
*
* @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
*
* @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
*
* @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function getPastCpuTime(): number;
/**
* Returns the system configuration at runtime.
*
* @param { number } name - Parameters defined by the system configuration.
* @returns { number } Return the system configuration at runtime.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.getSystemConfig
*/
function getSystemConfig(name: number): number;
/**
* Returns the system value for environment variables.
*
* @param { string } name - Parameters defined by the system environment variables.
* @returns { string } Return the system value for environment variables.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.getEnvironmentVar
*/
function getEnvironmentVar(name: string): string;
/**
* User Stored Events
*
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* User Stored Events
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* User Stored Events
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* User Stored Events
*
* @typedef { function } EventListener
* @param { Object } evt - User events
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
type EventListener = (evt: Object) => void;
/**
* Provides the ConditionType type,including timeout, killSignal, maxBuffer.
*
* @typedef ConditionType
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 10
* @test
*/
interface ConditionType {
/**
* Maximum running time (in ms) of the child process.
*
* @type { ?number }
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 10
* @test
*/
timeout?: number;
/**
* Signal sent to the child process when the running time of a child process exceeds the timeout period.
*
* @type { ?(number | string) }
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 10
* @test
*/
killSignal?: number | string;
/**
* Maximum buffer size for the standard input and output of the child process.
*
* @type { ?number }
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 10
* @test
*/
maxBuffer?: number;
}
/**
* Returns a child process object and spawns a new ChildProcess to run the command.
*
* @param { string } command - String of the shell commands executed by the child process.
* @param { ConditionType } options - This is an object. The object contains three parameters. Timeout is the running time of the child
* process, killSignal is the signal sent when the child process reaches timeout, and maxBuffer is the size of the
* maximum buffer area for standard input and output.
* @returns { ChildProcess } Returns a child process object.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
function runCmd(
command: string,
options?: ConditionType
): ChildProcess;
/**
* Abort current process
*
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* Abort current process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Abort current process
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function abort(): void;
/**
* Register for an event
*
* @param { string } type - Indicates the type of event registered.
* @param { EventListener } listener - Represents the registered event function
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
function on(type: string, listener: EventListener): void;
/**
* Remove registered event
*
* @param { string } type - Remove the type of registered event.
* @returns { boolean } Return removed result.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
function off(type: string): boolean;
/**
* Process exit
*
* @param { number } code - Process exit code.
* @syscap SystemCapability.Utils.Lang
* @since 7
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.exit
*/
function exit(code: number): void;
/**
* Return the current work directory;
*
* @returns { string } Return the current work directory.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
function cwd(): string;
/**
* Change current directory
*
* @param { string } dir - The path you want to change.
* @syscap SystemCapability.Utils.Lang
* @systemapi Hide this for inner system use
* @since 7
* @test
*/
function chdir(dir: string): void;
/**
* Returns the running time of the system
*
* @returns { number } Return the running time of the system.
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* Returns the running time of the system
*
* @returns { number } Return the running time of the system.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the running time of the system
*
* @returns { number } Return the running time of the system.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 11
*/
function uptime(): number;
/**
* Return whether the signal was sent successfully
*
* @param { number } signal - Signal sent.
* @param { number } pid - Send signal to target pid.
* @returns { boolean } Return the result of the signal.
* @syscap SystemCapability.Utils.Lang
* @since 7
* @deprecated since 9
* @useinstead ohos.process.ProcessManager.kill
*/
function kill(signal: number, pid: number): boolean;
}
export default process;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助