1# @ohos.app.ability.ChildProcessArgs
2
3The ChildProcessArgs module describes the parameters transferred to the child process. When starting a child process through [childProcessManager](js-apis-app-ability-childProcessManager.md), you can transfer parameters to the child process through **ChildProcessArgs**.
4
5> **NOTE**
6>
7> The initial APIs of this module are supported since API version 12. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8>
9> The APIs of this module can be used only in the stage model.
10
11## Modules to Import
12
13```ts
14import { ChildProcessArgs } from '@kit.AbilityKit';
15```
16
17## Properties
18
19**System capability**: SystemCapability.Ability.AbilityRuntime.Core
20
21| Name       | Type                   | Mandatory| Description                                                        |
22| ----------- | --------------------   | ---- | ------------------------------------------------------------ |
23| entryParams | string                 |  No | Custom parameters to be transparently transmit to the child process. The parameters can be obtained through **args.entryParams** in [ChildProcess.onStart](js-apis-app-ability-childProcess.md#childprocessonstart). The maximum data volume supported by **entryParams** is 150 KB.|
24| fds         | Record<string, number> |  No | File Descriptor (FD) handles, which are used for communication between the main process and child process. They are passed to the child process in the form of key-value pairs, where **key** is a custom string and **value** is a DF handle. The FD handles can be obtained through **args.fds** in [ChildProcess.onStart](js-apis-app-ability-childProcess.md#childprocessonstart).<br>NOTE<br>- **fds** supports a maximum of 16 groups. In each group, **key** contains a maximum of 20 characters.<br>- The ID of a handle passed to the child process may change, but the handle always points to the same file.|
25
26**Example**
27
28For details about how to obtain the context in the example, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability).
29
30```ts
31// In the main process:
32import { common, ChildProcessArgs, childProcessManager } from '@kit.AbilityKit';
33import fs from '@ohos.file.fs';
34
35let context = getContext(this) as common.UIAbilityContext;
36let path = context.filesDir + "/test.txt";
37let file = fs.openSync(path, fs.OpenMode.READ_ONLY | fs.OpenMode.CREATE);
38let args: ChildProcessArgs = {
39  entryParams: "testParam",
40  fds: {
41    "key1": file.fd
42  }
43};
44childProcessManager.startArkChildProcess("entry/./ets/process/DemoProcess.ets", args);
45```
46
47```ts
48// In the child process:
49import { ChildProcess, ChildProcessArgs } from '@kit.AbilityKit';
50
51export default class DemoProcess extends ChildProcess {
52
53  onStart(args?: ChildProcessArgs) {
54    let entryParams = args?.entryParams;
55    let fd = args?.fds?.key1;
56    // ..
57  }
58}
59```
60