• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @arkts.lang (ArkTS Base Capability)
2
3The module provides the basic type definition of ArkTS. Currently, the **ISendable** interface is provided.
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> This module can be imported only to ArkTS files (with the file name extension .ets).
10
11## Modules to Import
12
13```ts
14import { lang } from '@kit.ArkTS';
15```
16
17## lang.ISendable
18Parent type of all sendable types except null and undefined. It does not have any necessary methods or properties.
19
20An **ISendable** object is an instance of the Object type in ArkTS.
21
22**ISendable** is mainly used when you want to customize the sendable data structure. Container types in the ArkTS common library implicitly inherit and implement **ISendable**.
23
24**System capability**: SystemCapability.Utils.Lang
25
26**Example**
27
28```ts
29// Construct a custom sendable data structure.
30@Sendable
31class CustomData implements lang.ISendable {
32    data1: number;
33    data2: string;
34    constructor(data1: number, data2: string) {
35        this.data1 = data1;
36        this.data2 = data2;
37    }
38}
39```
40