• Home
Name Date Size #Lines LOC

..--

AppScope/22-Oct-2025-3532

createbigintint64/22-Oct-2025-618507

createbigintuint64/22-Oct-2025-620508

createbigintwords/22-Oct-2025-622511

getvaluebigintint64/22-Oct-2025-624513

getvaluebigintuint64/22-Oct-2025-625513

getvaluebigintwords/22-Oct-2025-703589

hvigor/22-Oct-2025-3836

screenshots/22-Oct-2025-

.gitignoreD22-Oct-2025144 1212

README.mdD22-Oct-20257.1 KiB169147

build-profile.json5D22-Oct-20252.6 KiB117116

code-linter.json5D22-Oct-2025992 3534

hvigorfile.tsD22-Oct-2025864 225

oh-package.json5D22-Oct-2025834 2624

ohosTest.mdD22-Oct-20251.6 KiB1411

README.md

1# ArkTS使用JSVM-API接口操作bigint类型值
2
3### 介绍
4
5BigInt是JavaScript中用于表示任意精度整数的数据类型,它能够处理比Number类型更大范围的整数值。通过JSVM-API提供的接口,可以在JSVM模块中创建、获取和操作BigInt类型值,从而实现与BigInt相关的功能扩展。
6
7该工程中展示的代码详细描述可查如下链接:
8
9- [使用JSVM-API接口操作bigint类型值](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/napi/use-jsvm-about-bigint.md)
10
11### 效果预览
12
13|                                首页                                 |                         执行及结果即时反馈                          |
14| :-----------------------------------------------------------------: | :-----------------------------------------------------------------: |
15| <img src="./screenshots/JsvmAboutBigint_1.png" style="zoom:33%;" /> | <img src="./screenshots/JsvmAboutBigint_2.png" style="zoom:33%;" /> |
16
17### 使用说明
18
191. 在主界面,可以点击Hello World,开始执行。
202. 执行结果会即时反馈在屏幕中央,并在控制台打印log。
21
22### 工程目录
23
24```
25createbigintint64/src/
26 ├── main
27 │   ├── cpp
28 │   │   ├── types
29 │   │   │   ├── libcreatebigintint64
30 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
31 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关联
32 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
33 │   │   ├── hello.cpp                   // 实现Native侧的runTest接口
34 │   ├── ets
35 │   │   ├── createbigintint64ability
36 │   │   ├── pages
37 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
38 │   ├── module.json5
39 │   └── resources
40 ├── ohosTest
41 │   ├── ets
42 │   │   ├── test
43 │   │       ├── Ability.test.ets        // 自动化测试代码
44createbigintuint64/src/
45 ├── main
46 │   ├── cpp
47 │   │   ├── types
48 │   │   │   ├── libcreatebigintuint64
49 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
50 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关联
51 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
52 │   │   ├── hello.cpp                   // 实现Native侧的runTest接口
53 │   ├── ets
54 │   │   ├── createbigintuint64ability
55 │   │   ├── pages
56 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
57 │   ├── module.json5
58 │   └── resources
59 ├── ohosTest
60 │   ├── ets
61 │   │   ├── test
62 │   │       ├── Ability.test.ets        // 自动化测试代码
63createbigintwords/src/
64 ├── main
65 │   ├── cpp
66 │   │   ├── types
67 │   │   │   ├── libcreatebigintwords
68 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
69 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关
70 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
71 │   │   ├── hello.cpp                   // 实现Native侧的runTest接
72 │   ├── ets
73 │   │   ├── createbigintwordsability
74 │   │   ├── pages
75 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
76 │   ├── module.json5
77 │   └── resources
78 ├── ohosTest
79 │   ├── ets
80 │   │   ├── test
81 │   │       ├── Ability.test.ets        // 自动化测试代码
82getvaluebigintint64/src/
83 ├── main
84 │   ├── cpp
85 │   │   ├── types
86 │   │   │   ├── libgetvaluebigintint64
87 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
88 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关
89 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
90 │   │   ├── hello.cpp                   // 实现Native侧的runTest接
91 │   ├── ets
92 │   │   ├── getvaluebigintint64ability
93 │   │   ├── pages
94 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
95 │   ├── module.json5
96 │   └── resources
97 ├── ohosTest
98 │   ├── ets
99 │   │   ├── test
100 │   │       ├── Ability.test.ets        // 自动化测试代码
101getvaluebigintuint64/src/
102 ├── main
103 │   ├── cpp
104 │   │   ├── types
105 │   │   │   ├── libgetvaluebigintuint64
106 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
107 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关
108 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
109 │   │   ├── hello.cpp                   // 实现Native侧的runTest接
110 │   ├── ets
111 │   │   ├── getvaluebigintuint64ability
112 │   │   ├── pages
113 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
114 │   ├── module.json5
115 │   └── resources
116 ├── ohosTest
117 │   ├── ets
118 │   │   ├── test
119 │   │       ├── Ability.test.ets        // 自动化测试代码
120getvaluebigintwords/src/
121 ├── main
122 │   ├── cpp
123 │   │   ├── types
124 │   │   │   ├── libentry
125 │   │   │   │   ├── Index.d.ts          // 提供JS侧的接口方法
126 │   │   │   │   ├── oh-package.json5 	 // 将index.d.ts与cpp文件关
127 │   │   ├── CMakeLists.txt              // 配置CMake打包参数
128 │   │   ├── hello.cpp                   // 实现Native侧的runTest接
129 │   ├── ets
130 │   │   ├── entryability
131 │   │   ├── entrybackupability
132 │   │   ├── pages
133 │   │       ├── Index.ets               // ArkTS侧调用C/C++方法实现
134 │   ├── module.json5
135 │   └── resources
136 ├── ohosTest
137 │   ├── ets
138 │   │   ├── test
139 │   │       ├── Ability.test.ets        // 自动化测试代码
140```
141
142### 相关权限
143
144不涉及。
145
146### 依赖
147
148不涉及。
149
150### 约束与限制
151
1521.本示例仅支持标准系统上运行, 支持设备:Phone。
153
1542.本示例为Stage模型,支持API15版本SDK,版本号:5.0.3.135,镜像版本号:HarmonyOS NEXT_5.0.3.135。
155
1563.本示例需要使用DevEco Studio 5.0.3 Release (Build Version: 5.0.9.300, built on March 13, 2025)及以上版本才可编译运行。
157
158### 下载
159
160如需单独下载本工程,执行如下命令:
161
162```
163git init
164git config core.sparsecheckout true
165echo code/DocsSample/ArkTS/JSVMAPI/JsvmUsageGuide/JsvmAboutBigint > .git/info/sparse-checkout
166git remote add origin https://gitee.com/openharmony/applications_app_samples.git
167git pull origin master
168```
169