@react-native-ohos/react-native-tcp-socket 6.3.1 → 6.4.0-bate.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.OpenSource +10 -10
  3. package/README.md +12 -12
  4. package/harmony/tcp_socket/BuildProfile.ets +17 -17
  5. package/harmony/tcp_socket/Index.ets +9 -6
  6. package/harmony/tcp_socket/build-profile.json5 +31 -31
  7. package/harmony/tcp_socket/hvigorfile.ts +6 -6
  8. package/harmony/tcp_socket/obfuscation-rules.txt +22 -22
  9. package/harmony/tcp_socket/oh-package.json5 +11 -11
  10. package/harmony/tcp_socket/src/main/cpp/CMakeLists.txt +8 -8
  11. package/harmony/tcp_socket/src/main/cpp/TcpSocketPackage.h +18 -18
  12. package/harmony/tcp_socket/src/main/cpp/generated/RNOH/generated/BaseReactNativeTcpSocketPackage.h +72 -72
  13. package/harmony/tcp_socket/src/main/cpp/generated/RNOH/generated/turbo_modules/TcpSocketModule.cpp +28 -28
  14. package/harmony/tcp_socket/src/main/cpp/generated/RNOH/generated/turbo_modules/TcpSocketModule.h +16 -16
  15. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/ComponentDescriptors.h +24 -24
  16. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/EventEmitters.cpp +16 -16
  17. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/EventEmitters.h +17 -17
  18. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/Props.cpp +19 -19
  19. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/Props.h +18 -18
  20. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/ShadowNodes.cpp +17 -17
  21. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/ShadowNodes.h +23 -23
  22. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/States.cpp +16 -16
  23. package/harmony/tcp_socket/src/main/cpp/generated/react/renderer/components/react_native_tcp_socket/States.h +18 -18
  24. package/harmony/tcp_socket/src/main/ets/Logger.ts +45 -45
  25. package/harmony/tcp_socket/src/main/ets/TcpEventListener.ts +120 -120
  26. package/harmony/tcp_socket/src/main/ets/TcpSocket.ts +16 -16
  27. package/harmony/tcp_socket/src/main/ets/TcpSocketClient.ts +443 -443
  28. package/harmony/tcp_socket/src/main/ets/{TcpSocketPackage.ts → TcpSocketPackage.ets} +27 -27
  29. package/harmony/tcp_socket/src/main/ets/TcpSocketServer.ts +150 -150
  30. package/harmony/tcp_socket/src/main/ets/TcpSocketTurboModule.ts +224 -224
  31. package/harmony/tcp_socket/src/main/ets/generated/components/ts.ts +5 -5
  32. package/harmony/tcp_socket/src/main/ets/generated/index.ets +5 -5
  33. package/harmony/tcp_socket/src/main/ets/generated/ts.ts +6 -6
  34. package/harmony/tcp_socket/src/main/ets/generated/turboModules/TcpSocketModule.ts +38 -38
  35. package/harmony/tcp_socket/src/main/ets/generated/turboModules/ts.ts +5 -5
  36. package/harmony/tcp_socket/src/main/module.json5 +11 -11
  37. package/harmony/tcp_socket/src/main/resources/base/element/string.json +8 -8
  38. package/harmony/tcp_socket/src/main/resources/en_US/element/string.json +8 -8
  39. package/harmony/tcp_socket/src/main/resources/zh_CN/element/string.json +8 -8
  40. package/harmony/tcp_socket/src/ohosTest/ets/test/Ability.test.ets +34 -34
  41. package/harmony/tcp_socket/src/ohosTest/ets/test/List.test.ets +4 -4
  42. package/harmony/tcp_socket/src/ohosTest/module.json5 +13 -13
  43. package/harmony/tcp_socket/src/test/List.test.ets +4 -4
  44. package/harmony/tcp_socket/src/test/LocalUnit.test.ets +32 -32
  45. package/harmony/tcp_socket/{ts.ts → ts.ets} +6 -6
  46. package/harmony/tcp_socket.har +0 -0
  47. package/lib/types/Globals.d.ts +2 -2
  48. package/lib/types/Server.d.ts +137 -137
  49. package/lib/types/Socket.d.ts +272 -272
  50. package/lib/types/TLSServer.d.ts +28 -28
  51. package/lib/types/TLSSocket.d.ts +50 -50
  52. package/lib/types/index.d.ts +80 -80
  53. package/package.json +83 -77
  54. package/src/Globals.js +12 -12
  55. package/src/Server.js +271 -271
  56. package/src/Socket.js +513 -513
  57. package/src/TLSServer.js +70 -70
  58. package/src/TLSSocket.js +93 -93
  59. package/src/TcpSocketModule.ts +39 -39
  60. package/src/index.js +144 -144
@@ -1,224 +1,224 @@
1
- /*
2
- * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
- * Use of this source code is governed by a MIT license that can be
4
- * found in the LICENSE file.
5
- */
6
- import { TurboModule, RNOHError, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
7
- import { TM } from "./generated/ts"
8
- import { TcpEventListener } from "./TcpEventListener"
9
- import { connection } from '@kit.NetworkKit';
10
- import { BusinessError } from '@kit.BasicServicesKit';
11
- import { TcpSocket } from './TcpSocket'
12
- import Logger from './Logger'
13
- import { TcpSocketClient } from './TcpSocketClient'
14
- import { TcpSocketServer } from './TcpSocketServer'
15
- import { util } from '@kit.ArkTS';
16
- import { Context } from '@kit.AbilityKit';
17
-
18
- export class TcpSocketTurboModule extends TurboModule implements TM.TcpSocketModule.Spec {
19
- private socketMap: Map<number, TcpSocket> = new Map<number, TcpSocket>();
20
- private pendingTLS: Map<number, Object> = new Map<number, Object>();
21
- private mNetworkMap: Map<string, connection.ConnectionProperties> =
22
- new Map<string, connection.ConnectionProperties>();
23
- private tcpEvtListener?: TcpEventListener;
24
- private currentNetwork?: connection.ConnectionProperties;
25
- private context: Context;
26
-
27
- constructor(ctx: TurboModuleContext) {
28
- super(ctx)
29
- this.tcpEvtListener = new TcpEventListener(ctx);
30
- this.context = ctx.uiAbilityContext
31
- }
32
-
33
- private getTcpClient(cid: number): TcpSocketClient | undefined {
34
- let socket: TcpSocket | undefined = this.socketMap.get(cid);
35
- if (socket && (socket instanceof TcpSocketClient)) {
36
- return socket as TcpSocketClient;
37
- }
38
- return undefined;
39
- }
40
-
41
- private getTcpServer(cid: number): TcpSocketServer | undefined {
42
- let socket: TcpSocket | undefined = this.socketMap.get(cid);
43
- if (socket && (socket instanceof TcpSocketServer)) {
44
- return socket as TcpSocketServer;
45
- }
46
- return undefined;
47
- }
48
-
49
- private async requestNetwork(transportType: number, iotDeviceHost: string): Promise<void> {
50
- if (!iotDeviceHost || "localhost" === iotDeviceHost) {
51
- this.getDefaultNetInfo();
52
- } else {
53
- let netHandles = connection.getAllNetsSync();
54
- for (const netHandle of netHandles) {
55
- let conpro = connection.getNetCapabilitiesSync(netHandle);
56
- if (conpro.bearerTypes.includes(transportType)) {
57
- await connection.setAppNet(netHandle, (error: BusinessError, data: void) => {
58
- if (error) {
59
- Logger.error(`setAppNet error. Code:${error.code}, message:${error.message}`);
60
- return;
61
- }
62
- Logger.info("setAppNet Succeeded");
63
- this.currentNetwork = connection.getConnectionPropertiesSync(netHandle);
64
- });
65
- }
66
- }
67
- }
68
- }
69
-
70
- private getDefaultNetInfo() {
71
- if (!connection.hasDefaultNetSync()) {
72
- Logger.info("has not default net")
73
- return;
74
- }
75
- let netHandle: connection.NetHandle = connection.getDefaultNetSync();
76
- this.currentNetwork = connection.getConnectionPropertiesSync(netHandle);
77
- }
78
-
79
- private async selectNetwork(ipAddress: string, iface: string, iotDeviceHost: string): Promise<void> {
80
- if (!iface) {
81
- return;
82
- }
83
- if (ipAddress) {
84
- let cachedNetwork = this.mNetworkMap.get(iface + ipAddress);
85
- if (cachedNetwork) {
86
- this.currentNetwork = cachedNetwork;
87
- }
88
- }
89
- switch (iface) {
90
- case 'wifi':
91
- await this.requestNetwork(connection.NetBearType.BEARER_WIFI, iotDeviceHost);
92
- break;
93
- case 'cellular':
94
- await this.requestNetwork(connection.NetBearType.BEARER_CELLULAR, iotDeviceHost);
95
- break;
96
- case 'ethernet':
97
- await this.requestNetwork(connection.NetBearType.BEARER_ETHERNET, iotDeviceHost);
98
- break;
99
- }
100
- if (!this.currentNetwork) {
101
- throw new Error("Interface " + iface + " unreachable");
102
- } else {
103
- this.mNetworkMap.set(iface + ipAddress, this.currentNetwork);
104
- }
105
- }
106
-
107
- async connect(cId: number, host: string, port: number, options: Object): Promise<void> {
108
- if (this.socketMap.get(cId)) {
109
- this.tcpEvtListener?.onError(cId, "connect() called twice with the same id.");
110
- return;
111
- }
112
- try {
113
- let localAddress: string = options['localAddress'];
114
- let iface: string = options['interface'];
115
- let iotDeviceHost: string = options['host'];
116
- this.selectNetwork(localAddress, iface, iotDeviceHost);
117
- let client: TcpSocketClient = new TcpSocketClient(this.tcpEvtListener, cId);
118
- this.socketMap.set(cId, client);
119
- let tlsOptions = this.pendingTLS.get(cId);
120
- await client.connect(host, port, options, tlsOptions);
121
- this.tcpEvtListener?.onConnect(cId, client);
122
- } catch (err) {
123
- this.tcpEvtListener?.onError(cId, err?.message);
124
- }
125
- }
126
-
127
- startTLS(cId: number, tlsOptions: Object): void {
128
- let socketClient: TcpSocketClient = this.socketMap.get(cId) as TcpSocketClient;
129
- if (!socketClient) {
130
- this.pendingTLS.set(cId, tlsOptions);
131
- } else {
132
- try {
133
- socketClient.startTLS(tlsOptions);
134
- } catch (e) {
135
- this.tcpEvtListener?.onError(cId, JSON.stringify(e));
136
- }
137
- }
138
- }
139
-
140
- listen(cId: number, options: Object): void {
141
- let tcpSocketServer = new TcpSocketServer(this.socketMap, this.tcpEvtListener, cId, options);
142
- this.socketMap.set(cId, tcpSocketServer);
143
- this.tcpEvtListener.onListen(cId, tcpSocketServer);
144
- }
145
-
146
- close(cid: number): void {
147
- let socketServer: TcpSocketServer = this.getTcpServer(cid);
148
- socketServer?.close();
149
- let socketClient: TcpSocketClient = this.getTcpClient(cid);
150
- socketClient?.destroy();
151
- this.socketMap.delete(cid);
152
- }
153
-
154
- destroy(cid: number): void {
155
- this.end(cid);
156
- }
157
-
158
- end(cid: number): void {
159
- let socketClient = this.getTcpClient(cid);
160
- socketClient?.destroy();
161
- this.socketMap.delete(cid);
162
- }
163
-
164
- pause(cid: number): void {
165
- let socketClient = this.getTcpClient(cid);
166
- socketClient?.pause();
167
- }
168
-
169
- resume(cid: number): void {
170
- let socketClient = this.getTcpClient(cid);
171
- socketClient?.resume();
172
- }
173
-
174
- write(cId: number, base64String: string, msgId: number): void {
175
- let socketClient = this.getTcpClient(cId);
176
- let base64Helper = new util.Base64Helper;
177
- let uint8Array = base64Helper.decodeSync(base64String)
178
- let buffer = uint8Array.buffer as ArrayBuffer;
179
- socketClient?.write(msgId, buffer);
180
- }
181
-
182
- setNoDelay(cId: number, noDelay: boolean): void {
183
- try {
184
- let socketClient = this.getTcpClient(cId);
185
- socketClient?.setNoDelay(noDelay);
186
- } catch (e) {
187
- this.tcpEvtListener?.onError(cId, JSON.stringify(e));
188
- }
189
- }
190
-
191
- setKeepAlive(cId: number, enable: boolean, initialDelay: number): void {
192
- try {
193
- let socketClient: TcpSocketClient = this.getTcpClient(cId);
194
- socketClient?.setKeepAlive(enable);
195
- } catch (e) {
196
- this.tcpEvtListener?.onError(cId, JSON.stringify(e));
197
- }
198
- }
199
-
200
- getPeerCertificate(cId: number): Promise<string> {
201
- try {
202
- let socketClient = this.getTcpClient(cId);
203
- return socketClient?.getPeerCertificate();
204
- } catch (e) {
205
- this.tcpEvtListener?.onError(cId, JSON.stringify(e));
206
- return new Promise<string>(() => {
207
- return ""
208
- });
209
- }
210
- }
211
-
212
- getCertificate(cId: number): Promise<string> {
213
- try {
214
- let socketClient = this.getTcpClient(cId);
215
- return socketClient?.getCertificate();
216
- } catch (e) {
217
- this.tcpEvtListener?.onError(cId, JSON.stringify(e));
218
- return new Promise<string>(() => {
219
- return ""
220
- });
221
- }
222
- }
223
- }
224
-
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ import { TurboModule, RNOHError, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
7
+ import { TM } from "./generated/ts"
8
+ import { TcpEventListener } from "./TcpEventListener"
9
+ import { connection } from '@kit.NetworkKit';
10
+ import { BusinessError } from '@kit.BasicServicesKit';
11
+ import { TcpSocket } from './TcpSocket'
12
+ import Logger from './Logger'
13
+ import { TcpSocketClient } from './TcpSocketClient'
14
+ import { TcpSocketServer } from './TcpSocketServer'
15
+ import { util } from '@kit.ArkTS';
16
+ import { Context } from '@kit.AbilityKit';
17
+
18
+ export class TcpSocketTurboModule extends TurboModule implements TM.TcpSocketModule.Spec {
19
+ private socketMap: Map<number, TcpSocket> = new Map<number, TcpSocket>();
20
+ private pendingTLS: Map<number, Object> = new Map<number, Object>();
21
+ private mNetworkMap: Map<string, connection.ConnectionProperties> =
22
+ new Map<string, connection.ConnectionProperties>();
23
+ private tcpEvtListener?: TcpEventListener;
24
+ private currentNetwork?: connection.ConnectionProperties;
25
+ private context: Context;
26
+
27
+ constructor(ctx: TurboModuleContext) {
28
+ super(ctx)
29
+ this.tcpEvtListener = new TcpEventListener(ctx);
30
+ this.context = ctx.uiAbilityContext
31
+ }
32
+
33
+ private getTcpClient(cid: number): TcpSocketClient | undefined {
34
+ let socket: TcpSocket | undefined = this.socketMap.get(cid);
35
+ if (socket && (socket instanceof TcpSocketClient)) {
36
+ return socket as TcpSocketClient;
37
+ }
38
+ return undefined;
39
+ }
40
+
41
+ private getTcpServer(cid: number): TcpSocketServer | undefined {
42
+ let socket: TcpSocket | undefined = this.socketMap.get(cid);
43
+ if (socket && (socket instanceof TcpSocketServer)) {
44
+ return socket as TcpSocketServer;
45
+ }
46
+ return undefined;
47
+ }
48
+
49
+ private async requestNetwork(transportType: number, iotDeviceHost: string): Promise<void> {
50
+ if (!iotDeviceHost || "localhost" === iotDeviceHost) {
51
+ this.getDefaultNetInfo();
52
+ } else {
53
+ let netHandles = connection.getAllNetsSync();
54
+ for (const netHandle of netHandles) {
55
+ let conpro = connection.getNetCapabilitiesSync(netHandle);
56
+ if (conpro.bearerTypes.includes(transportType)) {
57
+ await connection.setAppNet(netHandle, (error: BusinessError, data: void) => {
58
+ if (error) {
59
+ Logger.error(`setAppNet error. Code:${error.code}, message:${error.message}`);
60
+ return;
61
+ }
62
+ Logger.info("setAppNet Succeeded");
63
+ this.currentNetwork = connection.getConnectionPropertiesSync(netHandle);
64
+ });
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ private getDefaultNetInfo() {
71
+ if (!connection.hasDefaultNetSync()) {
72
+ Logger.info("has not default net")
73
+ return;
74
+ }
75
+ let netHandle: connection.NetHandle = connection.getDefaultNetSync();
76
+ this.currentNetwork = connection.getConnectionPropertiesSync(netHandle);
77
+ }
78
+
79
+ private async selectNetwork(ipAddress: string, iface: string, iotDeviceHost: string): Promise<void> {
80
+ if (!iface) {
81
+ return;
82
+ }
83
+ if (ipAddress) {
84
+ let cachedNetwork = this.mNetworkMap.get(iface + ipAddress);
85
+ if (cachedNetwork) {
86
+ this.currentNetwork = cachedNetwork;
87
+ }
88
+ }
89
+ switch (iface) {
90
+ case 'wifi':
91
+ await this.requestNetwork(connection.NetBearType.BEARER_WIFI, iotDeviceHost);
92
+ break;
93
+ case 'cellular':
94
+ await this.requestNetwork(connection.NetBearType.BEARER_CELLULAR, iotDeviceHost);
95
+ break;
96
+ case 'ethernet':
97
+ await this.requestNetwork(connection.NetBearType.BEARER_ETHERNET, iotDeviceHost);
98
+ break;
99
+ }
100
+ if (!this.currentNetwork) {
101
+ throw new Error("Interface " + iface + " unreachable");
102
+ } else {
103
+ this.mNetworkMap.set(iface + ipAddress, this.currentNetwork);
104
+ }
105
+ }
106
+
107
+ async connect(cId: number, host: string, port: number, options: Object): Promise<void> {
108
+ if (this.socketMap.get(cId)) {
109
+ this.tcpEvtListener?.onError(cId, "connect() called twice with the same id.");
110
+ return;
111
+ }
112
+ try {
113
+ let localAddress: string = options['localAddress'];
114
+ let iface: string = options['interface'];
115
+ let iotDeviceHost: string = options['host'];
116
+ this.selectNetwork(localAddress, iface, iotDeviceHost);
117
+ let client: TcpSocketClient = new TcpSocketClient(this.tcpEvtListener, cId);
118
+ this.socketMap.set(cId, client);
119
+ let tlsOptions = this.pendingTLS.get(cId);
120
+ await client.connect(host, port, options, tlsOptions);
121
+ this.tcpEvtListener?.onConnect(cId, client);
122
+ } catch (err) {
123
+ this.tcpEvtListener?.onError(cId, err?.message);
124
+ }
125
+ }
126
+
127
+ startTLS(cId: number, tlsOptions: Object): void {
128
+ let socketClient: TcpSocketClient = this.socketMap.get(cId) as TcpSocketClient;
129
+ if (!socketClient) {
130
+ this.pendingTLS.set(cId, tlsOptions);
131
+ } else {
132
+ try {
133
+ socketClient.startTLS(tlsOptions);
134
+ } catch (e) {
135
+ this.tcpEvtListener?.onError(cId, JSON.stringify(e));
136
+ }
137
+ }
138
+ }
139
+
140
+ listen(cId: number, options: Object): void {
141
+ let tcpSocketServer = new TcpSocketServer(this.socketMap, this.tcpEvtListener, cId, options);
142
+ this.socketMap.set(cId, tcpSocketServer);
143
+ this.tcpEvtListener.onListen(cId, tcpSocketServer);
144
+ }
145
+
146
+ close(cid: number): void {
147
+ let socketServer: TcpSocketServer = this.getTcpServer(cid);
148
+ socketServer?.close();
149
+ let socketClient: TcpSocketClient = this.getTcpClient(cid);
150
+ socketClient?.destroy();
151
+ this.socketMap.delete(cid);
152
+ }
153
+
154
+ destroy(cid: number): void {
155
+ this.end(cid);
156
+ }
157
+
158
+ end(cid: number): void {
159
+ let socketClient = this.getTcpClient(cid);
160
+ socketClient?.destroy();
161
+ this.socketMap.delete(cid);
162
+ }
163
+
164
+ pause(cid: number): void {
165
+ let socketClient = this.getTcpClient(cid);
166
+ socketClient?.pause();
167
+ }
168
+
169
+ resume(cid: number): void {
170
+ let socketClient = this.getTcpClient(cid);
171
+ socketClient?.resume();
172
+ }
173
+
174
+ write(cId: number, base64String: string, msgId: number): void {
175
+ let socketClient = this.getTcpClient(cId);
176
+ let base64Helper = new util.Base64Helper;
177
+ let uint8Array = base64Helper.decodeSync(base64String)
178
+ let buffer = uint8Array.buffer as ArrayBuffer;
179
+ socketClient?.write(msgId, buffer);
180
+ }
181
+
182
+ setNoDelay(cId: number, noDelay: boolean): void {
183
+ try {
184
+ let socketClient = this.getTcpClient(cId);
185
+ socketClient?.setNoDelay(noDelay);
186
+ } catch (e) {
187
+ this.tcpEvtListener?.onError(cId, JSON.stringify(e));
188
+ }
189
+ }
190
+
191
+ setKeepAlive(cId: number, enable: boolean, initialDelay: number): void {
192
+ try {
193
+ let socketClient: TcpSocketClient = this.getTcpClient(cId);
194
+ socketClient?.setKeepAlive(enable);
195
+ } catch (e) {
196
+ this.tcpEvtListener?.onError(cId, JSON.stringify(e));
197
+ }
198
+ }
199
+
200
+ getPeerCertificate(cId: number): Promise<string> {
201
+ try {
202
+ let socketClient = this.getTcpClient(cId);
203
+ return socketClient?.getPeerCertificate();
204
+ } catch (e) {
205
+ this.tcpEvtListener?.onError(cId, JSON.stringify(e));
206
+ return new Promise<string>(() => {
207
+ return ""
208
+ });
209
+ }
210
+ }
211
+
212
+ getCertificate(cId: number): Promise<string> {
213
+ try {
214
+ let socketClient = this.getTcpClient(cId);
215
+ return socketClient?.getCertificate();
216
+ } catch (e) {
217
+ this.tcpEvtListener?.onError(cId, JSON.stringify(e));
218
+ return new Promise<string>(() => {
219
+ return ""
220
+ });
221
+ }
222
+ }
223
+ }
224
+
@@ -1,5 +1,5 @@
1
-
2
- /**
3
- */
4
-
5
- export {}
1
+
2
+ /**
3
+ */
4
+
5
+ export {}
@@ -1,5 +1,5 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * from "./ts"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./ts"
@@ -1,6 +1,6 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * as RNC from "./components/ts"
6
- export * as TM from "./turboModules/ts"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * as RNC from "./components/ts"
6
+ export * as TM from "./turboModules/ts"
@@ -1,38 +1,38 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- import { Tag } from "@rnoh/react-native-openharmony/ts"
6
-
7
- export namespace TcpSocketModule {
8
- export const NAME = 'TcpSocketModule' as const
9
-
10
- export interface Spec {
11
- listen(cId: number, options: Object): void;
12
-
13
- close(cid: number): void;
14
-
15
- destroy(cid: number): void;
16
-
17
- end(cid: number): void;
18
-
19
- pause(cid: number): void;
20
-
21
- resume(cid: number): void;
22
-
23
- connect(cId: number, host: string, port: number, options: Object): void;
24
-
25
- startTLS(cId: number, tlsOptions: Object): void;
26
-
27
- write(cId: number, base64String: string, msgId: number): void;
28
-
29
- setNoDelay(cId: number, noDelay: boolean): void;
30
-
31
- setKeepAlive(cId: number, enable: boolean, initialDelay: number): void;
32
-
33
- getPeerCertificate(cId: number): Promise<string>;
34
-
35
- getCertificate(cId: number): Promise<string>;
36
-
37
- }
38
- }
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ import { Tag } from "@rnoh/react-native-openharmony/ts"
6
+
7
+ export namespace TcpSocketModule {
8
+ export const NAME = 'TcpSocketModule' as const
9
+
10
+ export interface Spec {
11
+ listen(cId: number, options: Object): void;
12
+
13
+ close(cid: number): void;
14
+
15
+ destroy(cid: number): void;
16
+
17
+ end(cid: number): void;
18
+
19
+ pause(cid: number): void;
20
+
21
+ resume(cid: number): void;
22
+
23
+ connect(cId: number, host: string, port: number, options: Object): void;
24
+
25
+ startTLS(cId: number, tlsOptions: Object): void;
26
+
27
+ write(cId: number, base64String: string, msgId: number): void;
28
+
29
+ setNoDelay(cId: number, noDelay: boolean): void;
30
+
31
+ setKeepAlive(cId: number, enable: boolean, initialDelay: number): void;
32
+
33
+ getPeerCertificate(cId: number): Promise<string>;
34
+
35
+ getCertificate(cId: number): Promise<string>;
36
+
37
+ }
38
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * from "./TcpSocketModule"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./TcpSocketModule"
@@ -1,11 +1,11 @@
1
- {
2
- "module": {
3
- "name": "tcp_socket",
4
- "type": "har",
5
- "deviceTypes": [
6
- "default",
7
- "tablet",
8
- "2in1"
9
- ]
10
- }
11
- }
1
+ {
2
+ "module": {
3
+ "name": "tcp_socket",
4
+ "type": "har",
5
+ "deviceTypes": [
6
+ "default",
7
+ "tablet",
8
+ "2in1"
9
+ ]
10
+ }
11
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "string": [
3
- {
4
- "name": "page_show",
5
- "value": "page from package"
6
- }
7
- ]
8
- }
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "page_show",
5
+ "value": "page from package"
6
+ }
7
+ ]
8
+ }