@iotize/device-com-ble.cordova 3.7.2 → 4.0.0-alpha.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.
- package/CHANGELOG.md +143 -0
- package/package.json +7 -21
- package/packages/common/byte-converter/src/lib/byte-converter.d.ts +30 -0
- package/packages/common/byte-converter/src/public_api.d.ts +1 -0
- package/packages/common/byte-stream/src/lib/kaitai/kaitai-stream-reader.d.ts +155 -0
- package/packages/common/byte-stream/src/lib/kaitai/kaitai-stream-writer.d.ts +76 -0
- package/packages/common/byte-stream/src/lib/kaitai/kaitai-stream.d.ts +209 -0
- package/packages/common/byte-stream/src/lib/utility.d.ts +16 -0
- package/packages/common/byte-stream/src/public_api.d.ts +4 -0
- package/packages/common/converter/api/src/lib/converter.interface.d.ts +3 -0
- package/packages/common/converter/api/src/lib/decoder.interface.d.ts +4 -0
- package/packages/common/converter/api/src/lib/encoder-decoder.interface.d.ts +5 -0
- package/packages/common/converter/api/src/lib/encoder.interface.d.ts +4 -0
- package/packages/common/converter/api/src/public_api.d.ts +4 -0
- package/packages/common/debug/src/lib/debug.d.ts +7 -0
- package/packages/common/debug/src/public_api.d.ts +1 -0
- package/packages/common/error/src/lib/base-error.d.ts +3 -0
- package/packages/common/error/src/lib/code-error.d.ts +9 -0
- package/packages/common/error/src/public_api.d.ts +2 -0
- package/packages/common/promise/src/lib/promise-delay.d.ts +6 -0
- package/packages/common/promise/src/lib/promise-serial.d.ts +6 -0
- package/packages/common/promise/src/lib/promise-timeout.d.ts +10 -0
- package/packages/common/promise/src/public_api.d.ts +3 -0
- package/packages/common/task-manager/src/lib/cancelable-task.d.ts +22 -0
- package/packages/common/task-manager/src/lib/debug.d.ts +2 -0
- package/packages/common/task-manager/src/lib/definitions.d.ts +16 -0
- package/packages/common/task-manager/src/lib/step-operations.d.ts +112 -0
- package/packages/common/task-manager/src/lib/task-queue.d.ts +28 -0
- package/packages/common/task-manager/src/public_api.d.ts +4 -0
- package/packages/common/tlv/src/lib/debug.d.ts +2 -0
- package/packages/common/tlv/src/lib/tlv.d.ts +65 -0
- package/packages/common/tlv/src/public_api.d.ts +1 -0
- package/packages/common/utility/src/lib/assert-error.d.ts +1 -0
- package/packages/common/utility/src/lib/deep-copy.d.ts +14 -0
- package/packages/common/utility/src/lib/enum-util.d.ts +23 -0
- package/packages/common/utility/src/lib/sleep.d.ts +1 -0
- package/packages/common/utility/src/lib/utility.d.ts +1 -0
- package/packages/common/utility/src/public_api.d.ts +5 -0
- package/{lib → packages/device-com-ble.cordova/src/lib}/ble-com-protocol.d.ts +20 -20
- package/{lib → packages/device-com-ble.cordova/src/lib}/cordova-ble-error.d.ts +29 -29
- package/{lib → packages/device-com-ble.cordova/src/lib}/cordova-interface.d.ts +5 -5
- package/{lib → packages/device-com-ble.cordova/src/lib}/cordova-service-adapter.d.ts +58 -58
- package/{lib → packages/device-com-ble.cordova/src/lib}/definitions.d.ts +43 -43
- package/{lib → packages/device-com-ble.cordova/src/lib}/iotize-ble-cordova-plugin.d.ts +27 -27
- package/packages/device-com-ble.cordova/src/lib/logger.d.ts +2 -0
- package/{lib → packages/device-com-ble.cordova/src/lib}/scanner.d.ts +55 -55
- package/{lib → packages/device-com-ble.cordova/src/lib}/utility.d.ts +6 -6
- package/packages/device-com-ble.cordova/src/plugin.d.ts +7 -0
- package/packages/tap/client/api/src/lib/converter/definitions.d.ts +7 -0
- package/packages/tap/client/api/src/lib/definitions.d.ts +20 -0
- package/packages/tap/client/api/src/lib/generated/models.d.ts +150 -0
- package/packages/tap/client/api/src/lib/result-code.d.ts +170 -0
- package/packages/tap/client/api/src/lib/tap-client.interface.d.ts +28 -0
- package/packages/tap/client/api/src/public_api.d.ts +6 -0
- package/packages/tap/client/impl/src/lib/apdu/tap-apdu-request-builder.d.ts +2 -0
- package/packages/tap/client/impl/src/lib/converter/body/array-converter.d.ts +15 -0
- package/packages/tap/client/impl/src/lib/converter/body/boolean-decoder.d.ts +12 -0
- package/packages/tap/client/impl/src/lib/converter/body/byte-swap-converter.d.ts +26 -0
- package/packages/tap/client/impl/src/lib/converter/body/enum-converter.d.ts +23 -0
- package/packages/tap/client/impl/src/lib/converter/body/float-converter.d.ts +20 -0
- package/packages/tap/client/impl/src/lib/converter/body/hex-string.d.ts +8 -0
- package/packages/tap/client/impl/src/lib/converter/body/ipv4-string-decoder.d.ts +8 -0
- package/packages/tap/client/impl/src/lib/converter/body/mac-address-string-decoder.d.ts +7 -0
- package/packages/tap/client/impl/src/lib/converter/body/multiple-mask-decoder.d.ts +15 -0
- package/packages/tap/client/impl/src/lib/converter/body/number-converter.d.ts +54 -0
- package/packages/tap/client/impl/src/lib/converter/body/pipe-converter.d.ts +29 -0
- package/packages/tap/client/impl/src/lib/converter/body/string-converter.d.ts +44 -0
- package/packages/tap/client/impl/src/lib/converter/body/string-version-converter.d.ts +6 -0
- package/packages/tap/client/impl/src/lib/converter/body/tlv-bundle-converter.d.ts +22 -0
- package/packages/tap/client/impl/src/lib/converter/body/uniq-mask-decoder.d.ts +29 -0
- package/packages/tap/client/impl/src/lib/converter/crypted-frame-converter.d.ts +13 -0
- package/packages/tap/client/impl/src/lib/converter/error.d.ts +15 -0
- package/packages/tap/client/impl/src/lib/converter/tlv-converter.d.ts +9 -0
- package/packages/tap/client/impl/src/lib/converters.d.ts +13 -0
- package/packages/tap/client/impl/src/lib/debug.d.ts +2 -0
- package/packages/tap/client/impl/src/lib/error-detection/checksum.d.ts +3 -0
- package/packages/tap/client/impl/src/lib/error-detection/crc.d.ts +12 -0
- package/packages/tap/client/impl/src/lib/frame/import-adapter.d.ts +1 -0
- package/packages/tap/client/impl/src/lib/frame/tap-stream-core.d.ts +41 -0
- package/packages/tap/client/impl/src/lib/frame/tap-stream-encoder-decoder.d.ts +5 -0
- package/packages/tap/client/impl/src/lib/frame/tap-stream-extended.d.ts +2 -0
- package/packages/tap/client/impl/src/lib/generated/converter-stream-extension.d.ts +30 -0
- package/packages/tap/client/impl/src/lib/generated/converter.d.ts +35 -0
- package/packages/tap/client/impl/src/lib/generated-adapter.d.ts +2 -0
- package/packages/tap/client/impl/src/lib/interceptors/interceptor-chain.d.ts +9 -0
- package/packages/tap/client/impl/src/lib/model/models.extensions.d.ts +2 -0
- package/packages/tap/client/impl/src/lib/request/tap-request-builder.d.ts +13 -0
- package/packages/tap/client/impl/src/lib/request/tap-request-helper.d.ts +9 -0
- package/packages/tap/client/impl/src/lib/response/result-code-translation.d.ts +170 -0
- package/packages/tap/client/impl/src/lib/response/tap-response-builder.d.ts +6 -0
- package/packages/tap/client/impl/src/lib/response/tap-response-status-to-string.d.ts +1 -0
- package/packages/tap/client/impl/src/lib/tap-client-error.d.ts +33 -0
- package/packages/tap/client/impl/src/lib/tap-client.d.ts +74 -0
- package/packages/tap/client/impl/src/public_api.d.ts +39 -0
- package/packages/tap/protocol/api/src/lib/com-protocol.interface.d.ts +76 -0
- package/packages/tap/protocol/api/src/lib/definitions.d.ts +6 -0
- package/packages/tap/protocol/api/src/public_api.d.ts +2 -0
- package/packages/tap/protocol/ble/common/src/lib/abstract-ble-protocol.d.ts +49 -0
- package/packages/tap/protocol/ble/common/src/lib/ble-config.d.ts +20 -0
- package/packages/tap/protocol/ble/common/src/lib/ble-packet-builder.d.ts +31 -0
- package/packages/tap/protocol/ble/common/src/lib/ble-packet-splitter.d.ts +34 -0
- package/packages/tap/protocol/ble/common/src/lib/debug.d.ts +2 -0
- package/packages/tap/protocol/ble/common/src/lib/errors.d.ts +28 -0
- package/packages/tap/protocol/ble/common/src/lib/universal-ble-protocol-adapter.d.ts +146 -0
- package/packages/tap/protocol/ble/common/src/lib/util.d.ts +1 -0
- package/packages/tap/protocol/ble/common/src/public_api.d.ts +6 -0
- package/packages/tap/protocol/core/src/lib/abstract-com-protocol.d.ts +23 -0
- package/packages/tap/protocol/core/src/lib/debug.d.ts +2 -0
- package/packages/tap/protocol/core/src/lib/queue-com-protocol.d.ts +35 -0
- package/packages/tap/protocol/core/src/public_api.d.ts +2 -0
- package/packages/tap/scanner/api/src/lib/definitions.d.ts +35 -0
- package/packages/tap/scanner/api/src/public_api.d.ts +1 -0
- package/plugin.cjs +9057 -0
- package/plugin.js +9047 -0
- package/plugin.xml +8 -3
- package/src/android/build.gradle +2 -11
- package/src/android/libs/iotize-device-com-ble-1.0.0-alpha.9.aar +0 -0
- package/src/windows/iotize-ble-com.js +11 -11
- package/LICENSE +0 -23
- package/README.md +0 -174
- package/bundles/iotize-device-com-ble.cordova.umd.js +0 -1418
- package/bundles/iotize-device-com-ble.cordova.umd.js.map +0 -1
- package/bundles/iotize-device-com-ble.cordova.umd.min.js +0 -2
- package/bundles/iotize-device-com-ble.cordova.umd.min.js.map +0 -1
- package/esm2015/iotize-device-com-ble.cordova.js +0 -6
- package/esm2015/iotize-device-com-ble.cordova.js.map +0 -1
- package/esm2015/iotize-device-com-ble.cordova.metadata.json +0 -1
- package/esm2015/iotize-device-com-ble.cordova.ngsummary.json +0 -1
- package/esm2015/lib/ble-com-protocol.js +0 -76
- package/esm2015/lib/ble-com-protocol.js.map +0 -1
- package/esm2015/lib/ble-com-protocol.metadata.json +0 -1
- package/esm2015/lib/ble-com-protocol.ngsummary.json +0 -1
- package/esm2015/lib/cordova-ble-error.js +0 -36
- package/esm2015/lib/cordova-ble-error.js.map +0 -1
- package/esm2015/lib/cordova-ble-error.metadata.json +0 -1
- package/esm2015/lib/cordova-ble-error.ngsummary.json +0 -1
- package/esm2015/lib/cordova-interface.js +0 -2
- package/esm2015/lib/cordova-interface.js.map +0 -1
- package/esm2015/lib/cordova-interface.metadata.json +0 -1
- package/esm2015/lib/cordova-interface.ngsummary.json +0 -1
- package/esm2015/lib/cordova-service-adapter.js +0 -214
- package/esm2015/lib/cordova-service-adapter.js.map +0 -1
- package/esm2015/lib/cordova-service-adapter.metadata.json +0 -1
- package/esm2015/lib/cordova-service-adapter.ngsummary.json +0 -1
- package/esm2015/lib/definitions.js +0 -2
- package/esm2015/lib/definitions.js.map +0 -1
- package/esm2015/lib/definitions.metadata.json +0 -1
- package/esm2015/lib/definitions.ngsummary.json +0 -1
- package/esm2015/lib/iotize-ble-cordova-plugin.js +0 -170
- package/esm2015/lib/iotize-ble-cordova-plugin.js.map +0 -1
- package/esm2015/lib/iotize-ble-cordova-plugin.metadata.json +0 -1
- package/esm2015/lib/iotize-ble-cordova-plugin.ngsummary.json +0 -1
- package/esm2015/lib/logger.js +0 -3
- package/esm2015/lib/logger.js.map +0 -1
- package/esm2015/lib/logger.metadata.json +0 -1
- package/esm2015/lib/logger.ngsummary.json +0 -1
- package/esm2015/lib/scanner.js +0 -151
- package/esm2015/lib/scanner.js.map +0 -1
- package/esm2015/lib/scanner.metadata.json +0 -1
- package/esm2015/lib/scanner.ngsummary.json +0 -1
- package/esm2015/lib/utility.js +0 -26
- package/esm2015/lib/utility.js.map +0 -1
- package/esm2015/lib/utility.metadata.json +0 -1
- package/esm2015/lib/utility.ngsummary.json +0 -1
- package/esm2015/public_api.js +0 -5
- package/esm2015/public_api.js.map +0 -1
- package/esm2015/public_api.metadata.json +0 -1
- package/esm2015/public_api.ngsummary.json +0 -1
- package/fesm2015/iotize-device-com-ble.cordova.js +0 -660
- package/fesm2015/iotize-device-com-ble.cordova.js.map +0 -1
- package/iotize-device-com-ble.cordova.d.ts +0 -6
- package/iotize-device-com-ble.cordova.metadata.json +0 -1
- package/lib/logger.d.ts +0 -1
- package/public_api.d.ts +0 -5
- package/www/plugin.js +0 -2
- package/www/plugin.js.LICENSE.txt +0 -14
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
## 3.5.2 (2024-01-02)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- fix ble connection status after `connect()` method successful. 28642ac
|
|
6
|
+
|
|
7
|
+
## 3.5.1 (2023-11-21)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- android.permission.ACCESS_FINE_LOCATION for maxSdkVersion 32 399971d
|
|
12
|
+
|
|
13
|
+
# 3.5.0 (2023-11-21)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- added support for rxjs@7 98c7a3b
|
|
18
|
+
|
|
19
|
+
## 3.4.2 (2023-07-17)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
- fix android `BLECom.close()` method on Android 11 and below 8375e49
|
|
24
|
+
|
|
25
|
+
# 3.4.1 (2023-02-20)
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- added check permission before attempting BLE tap connect (**Android only**) 66b7418
|
|
30
|
+
- detect ble disconnection error during send requests and remove peripheral from cache to allow reconnection de556ca
|
|
31
|
+
|
|
32
|
+
### Others
|
|
33
|
+
|
|
34
|
+
- Updated dependency `org.apache.commons:commons-collections4:4.1` to `org.apache.commons:commons-collections4:4.4`
|
|
35
|
+
|
|
36
|
+
# 3.4.0 (2022-11-23)
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
- Support for android target sdk 31 (Android 11)
|
|
41
|
+
|
|
42
|
+
## 3.3.2 (2022-09-12)
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
- changed default connection priority to CONNECTION_PRIORITY_BALANCED (to work with TAP WB) 0e38fc6
|
|
47
|
+
- fix des problèmes de build auto sur iOS 15
|
|
48
|
+
|
|
49
|
+
## 3.3.1 (2022-03-22)
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
- added gradle option allowInsecureProtocol = true 4111e89
|
|
54
|
+
|
|
55
|
+
# 3.3.0 (2022-01-11)
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
- added additional `CordovaBLEError.Code` error 0e123b5
|
|
60
|
+
- ask user to enable ble on connect if it's currently disabled 7da5d14
|
|
61
|
+
|
|
62
|
+
## 3.2.1 (2022-01-11)
|
|
63
|
+
|
|
64
|
+
### Features
|
|
65
|
+
|
|
66
|
+
- added `close()` exposed method def9d79
|
|
67
|
+
- added `requestEnableBle()` method f5453e4
|
|
68
|
+
|
|
69
|
+
## 3.1.0 (2021-09-30)
|
|
70
|
+
|
|
71
|
+
- Changed plugin identifier from `cordova-plugin-iotize-device-com-ble` to `@iotize/device-com-ble.cordova` (requires cordova >= 10)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
- added functions to `IoTizeBleCordovaPlugin`:
|
|
76
|
+
- `requestMTU`
|
|
77
|
+
- `characteristicStartNotification`
|
|
78
|
+
- `characteristicStopNotification`
|
|
79
|
+
- `characteristicReadValue`
|
|
80
|
+
- `characteristicWrite`
|
|
81
|
+
- `characteristicWriteWithoutResponse`
|
|
82
|
+
|
|
83
|
+
## 3.0.2 (2021-03-02)
|
|
84
|
+
|
|
85
|
+
- fix optional constructor parameter for `BLEScanner`
|
|
86
|
+
|
|
87
|
+
## 3.0.1 (2021-03-02)
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
- lazy reference to iotizeBLE. iotizeBLE variable will not be referenced until it's required. bf783c7
|
|
92
|
+
|
|
93
|
+
<a name="3.0.0"></a>
|
|
94
|
+
|
|
95
|
+
# [3.0.0](https://bitbucket.org/iotize-solutions/tap-workspace/compare/v3.0.0-alpha.1...v3.0.0) (2021-02-19)
|
|
96
|
+
|
|
97
|
+
<a name="3.0.0-alpha.1"></a>
|
|
98
|
+
|
|
99
|
+
# [3.0.0-alpha.1](https://bitbucket.org/iotize-solutions/tap-workspace/compare/v2.0.0-alpha.5...v3.0.0-alpha.1) (2020-12-11)
|
|
100
|
+
|
|
101
|
+
- Migrated to `@iotize/tap@2.0.0` APIs
|
|
102
|
+
|
|
103
|
+
<a name="2.0.0-alpha.5"></a>
|
|
104
|
+
|
|
105
|
+
# [2.0.0-alpha.5] (2020-08-28)
|
|
106
|
+
|
|
107
|
+
### Bug Fixes
|
|
108
|
+
|
|
109
|
+
- changed background thread in iOS swift plugin 4d61ef4
|
|
110
|
+
- `checkState` waits for an update only if BLE state is unknown. 5260298
|
|
111
|
+
- Scan no longer needs active location to work fb2b469
|
|
112
|
+
- **scanner:** fix "ble" spelling to "BLE" ce6c3cb
|
|
113
|
+
|
|
114
|
+
### Features
|
|
115
|
+
|
|
116
|
+
- renamed interface `DiscoveredDeviceType` into `CordovaBLEScanResult` 3ed0259
|
|
117
|
+
|
|
118
|
+
<a name="1.1.0-alpha.30"></a>
|
|
119
|
+
|
|
120
|
+
- Improved BLE device Scanner
|
|
121
|
+
|
|
122
|
+
<a name="1.1.0-alpha.23"></a>
|
|
123
|
+
|
|
124
|
+
- fix: iOS : CheckAvailable now uses actual bluetooth manager state
|
|
125
|
+
|
|
126
|
+
<a name="1.1.0-alpha.21"></a>
|
|
127
|
+
|
|
128
|
+
# [1.1.0-alpha.21](2019-04-04)
|
|
129
|
+
|
|
130
|
+
- fix: Scan no longer needs active location to work
|
|
131
|
+
|
|
132
|
+
<a name="1.1.0-alpha.20"></a>
|
|
133
|
+
|
|
134
|
+
# [1.1.0-alpha.20](2019-03-06)
|
|
135
|
+
|
|
136
|
+
## Breaking changes :
|
|
137
|
+
|
|
138
|
+
- Added minified files
|
|
139
|
+
- non minified js and typescript declaration files now imported from '@iotize/cordova-device-iotize-ble' (used to be '@iotize/cordova-device-iotize-ble/dist')
|
|
140
|
+
|
|
141
|
+
<a name="1.1.0-alpha.18"></a>
|
|
142
|
+
|
|
143
|
+
# [1.1.0-alpha.18](2019-03-06)
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "IoTize <contact@iotize.com>",
|
|
3
3
|
"license": "MIT",
|
|
4
|
+
"homepage": "http://developer.iotize.com",
|
|
4
5
|
"name": "@iotize/device-com-ble.cordova",
|
|
5
|
-
"version": "
|
|
6
|
+
"version": "4.0.0-alpha.1",
|
|
7
|
+
"main": "plugin.js",
|
|
8
|
+
"types": "packages/device-com-ble.cordova/src/plugin.d.ts",
|
|
6
9
|
"cordova": {
|
|
7
10
|
"id": "@iotize/device-com-ble.cordova",
|
|
8
11
|
"platforms": [
|
|
@@ -12,12 +15,7 @@
|
|
|
12
15
|
]
|
|
13
16
|
},
|
|
14
17
|
"description": "Bluetooth Low Energy (BLE) for IoTize modules Plugin",
|
|
15
|
-
"peerDependencies": {
|
|
16
|
-
"@iotize/common": "^2.0.0",
|
|
17
|
-
"@iotize/tap": "^2.8.0",
|
|
18
|
-
"debug": "^4.1.0",
|
|
19
|
-
"rxjs": "^6.0.0 || ^7.0.0"
|
|
20
|
-
},
|
|
18
|
+
"peerDependencies": {},
|
|
21
19
|
"keywords": [
|
|
22
20
|
"bluetooth",
|
|
23
21
|
"BLE",
|
|
@@ -34,17 +32,5 @@
|
|
|
34
32
|
"cordova-android",
|
|
35
33
|
"cordova-windows",
|
|
36
34
|
"cordova-ios"
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
"main": "bundles/iotize-device-com-ble.cordova.umd.js",
|
|
40
|
-
"module": "fesm2015/iotize-device-com-ble.cordova.js",
|
|
41
|
-
"es2015": "fesm2015/iotize-device-com-ble.cordova.js",
|
|
42
|
-
"esm2015": "esm2015/iotize-device-com-ble.cordova.js",
|
|
43
|
-
"fesm2015": "fesm2015/iotize-device-com-ble.cordova.js",
|
|
44
|
-
"typings": "iotize-device-com-ble.cordova.d.ts",
|
|
45
|
-
"metadata": "iotize-device-com-ble.cordova.metadata.json",
|
|
46
|
-
"sideEffects": false,
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"tslib": "^2.2.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a ASCII string to byte buffer
|
|
3
|
+
* For example "01" will give [0x30, 0x31]
|
|
4
|
+
* @param str
|
|
5
|
+
*/
|
|
6
|
+
export declare function asciiStringToByteBuffer(str: string): Uint8Array;
|
|
7
|
+
export declare function typedArrayToBuffer(array: Uint8Array): ArrayBuffer;
|
|
8
|
+
/**
|
|
9
|
+
* Convert a byte buffer to the hexadecimal string representation
|
|
10
|
+
* For example [0x1, 0x2] will returns string "0102"
|
|
11
|
+
* @param buffer
|
|
12
|
+
*/
|
|
13
|
+
export declare function bufferToHexString(buffer: Uint8Array): string;
|
|
14
|
+
/**
|
|
15
|
+
* Convert a byte buffer to the binary string representation
|
|
16
|
+
* For example [0x1, 0x2] will returns string "0000000100000002"
|
|
17
|
+
* @param buffer
|
|
18
|
+
*/
|
|
19
|
+
export declare function bufferToBinaryString(buffer: Uint8Array): string;
|
|
20
|
+
/**
|
|
21
|
+
* Convert an hexadecimal string to a buffer
|
|
22
|
+
* For example "0102" or "01 02" will returns string [0x1, 0x2]
|
|
23
|
+
* @param hexString
|
|
24
|
+
*/
|
|
25
|
+
export declare function hexStringToBuffer(hexString: string): Uint8Array;
|
|
26
|
+
/**
|
|
27
|
+
* Converts data to an ascii string
|
|
28
|
+
* @param data
|
|
29
|
+
*/
|
|
30
|
+
export declare function bufferToAsciiString(data: Uint8Array | number[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/byte-converter';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { KaitaiStream, StreamBufferType } from './kaitai-stream';
|
|
2
|
+
/**
|
|
3
|
+
* KaitaiStreamReader is an implementation of Kaitai Struct API for JavaScript.
|
|
4
|
+
*
|
|
5
|
+
* Some functions are based on KaitaiStream.js - https://github.com/kaitai-io/kaitai_struct_javascript_runtime/blob/master/KaitaiStream.js that comes with the following license
|
|
6
|
+
*
|
|
7
|
+
* @license Copyright 2012-2016 Ilmari Heikkinen Copyright 2016-2020 Kaitai Project licensed under Apache License, Version 2.0 (the "License");
|
|
8
|
+
*
|
|
9
|
+
* Implementation has been translated to Typescript and modified to fit our needs
|
|
10
|
+
*/
|
|
11
|
+
export declare class KaitaiStreamReader extends KaitaiStream {
|
|
12
|
+
static fromArray(array: Uint8Array): KaitaiStreamReader;
|
|
13
|
+
static create(packet: Uint8Array | KaitaiStreamReader): KaitaiStreamReader;
|
|
14
|
+
/**
|
|
15
|
+
* @param arrayBuffer ArrayBuffer to read from.
|
|
16
|
+
* @param byteOffset Offset from arrayBuffer beginning for the KaitaiStream.
|
|
17
|
+
*/
|
|
18
|
+
constructor(arrayBuffer?: StreamBufferType, byteOffset?: number, isBigEndian?: boolean);
|
|
19
|
+
readS(size: 1 | 2 | 4): number;
|
|
20
|
+
readSigned(size: 1 | 2 | 4): number;
|
|
21
|
+
read(type: 'f' | 'u' | 's' | 'b', bitSize: number, isLittleEndian?: boolean): any;
|
|
22
|
+
/**
|
|
23
|
+
Reads an 8-bit signed int from the stream.
|
|
24
|
+
@return {number} The read number.
|
|
25
|
+
*/
|
|
26
|
+
readS1(): number;
|
|
27
|
+
/**
|
|
28
|
+
Reads a 16-bit big-endian signed int from the stream.
|
|
29
|
+
@return {number} The read number.
|
|
30
|
+
*/
|
|
31
|
+
readS2be(): number;
|
|
32
|
+
/**
|
|
33
|
+
Reads a 32-bit big-endian signed int from the stream.
|
|
34
|
+
@return {number} The read number.
|
|
35
|
+
*/
|
|
36
|
+
readS4be(): number;
|
|
37
|
+
/**
|
|
38
|
+
Reads a 64-bit big-endian unsigned int from the stream. Note that
|
|
39
|
+
JavaScript does not support 64-bit integers natively, so it will
|
|
40
|
+
automatically upgrade internal representation to use IEEE 754
|
|
41
|
+
double precision float.
|
|
42
|
+
@return {number} The read number.
|
|
43
|
+
*/
|
|
44
|
+
readS8be(): number;
|
|
45
|
+
/**
|
|
46
|
+
Reads a 16-bit little-endian signed int from the stream.
|
|
47
|
+
@return {number} The read number.
|
|
48
|
+
*/
|
|
49
|
+
readS2le(): number;
|
|
50
|
+
/**
|
|
51
|
+
Reads a 32-bit little-endian signed int from the stream.
|
|
52
|
+
@return {number} The read number.
|
|
53
|
+
*/
|
|
54
|
+
readS4le(): number;
|
|
55
|
+
/**
|
|
56
|
+
Reads a 64-bit little-endian unsigned int from the stream. Note that
|
|
57
|
+
JavaScript does not support 64-bit integers natively, so it will
|
|
58
|
+
automatically upgrade internal representation to use IEEE 754
|
|
59
|
+
double precision float.
|
|
60
|
+
@return {number} The read number.
|
|
61
|
+
*/
|
|
62
|
+
readS8le(): number;
|
|
63
|
+
/**
|
|
64
|
+
* Read unsigned
|
|
65
|
+
* @param size
|
|
66
|
+
*/
|
|
67
|
+
readU(size: 1 | 2 | 4 | number): number;
|
|
68
|
+
readUnsigned(size: 1 | 2 | 4 | number): number;
|
|
69
|
+
/**
|
|
70
|
+
Reads an 8-bit unsigned int from the stream.
|
|
71
|
+
@return {number} The read number.
|
|
72
|
+
*/
|
|
73
|
+
readU1(): number;
|
|
74
|
+
/**
|
|
75
|
+
Reads a 16-bit big-endian unsigned int from the stream.
|
|
76
|
+
@return {number} The read number.
|
|
77
|
+
*/
|
|
78
|
+
readU2be(): number;
|
|
79
|
+
/**
|
|
80
|
+
Reads a 32-bit big-endian unsigned int from the stream.
|
|
81
|
+
@return {number} The read number.
|
|
82
|
+
*/
|
|
83
|
+
readU4be(): number;
|
|
84
|
+
/**
|
|
85
|
+
Reads a 64-bit big-endian unsigned int from the stream. Note that
|
|
86
|
+
JavaScript does not support 64-bit integers natively, so it will
|
|
87
|
+
automatically upgrade internal representation to use IEEE 754
|
|
88
|
+
double precision float.
|
|
89
|
+
@return {number} The read number.
|
|
90
|
+
*/
|
|
91
|
+
readU8be(): number;
|
|
92
|
+
/**
|
|
93
|
+
Reads a 16-bit little-endian unsigned int from the stream.
|
|
94
|
+
@return {number} The read number.
|
|
95
|
+
*/
|
|
96
|
+
readU2le(): number;
|
|
97
|
+
/**
|
|
98
|
+
Reads a 32-bit little-endian unsigned int from the stream.
|
|
99
|
+
@return {number} The read number.
|
|
100
|
+
*/
|
|
101
|
+
readU4le(): number;
|
|
102
|
+
/**
|
|
103
|
+
Reads a 64-bit little-endian unsigned int from the stream. Note that
|
|
104
|
+
JavaScript does not support 64-bit integers natively, so it will
|
|
105
|
+
automatically upgrade internal representation to use IEEE 754
|
|
106
|
+
double precision float.
|
|
107
|
+
@return {number} The read number.
|
|
108
|
+
*/
|
|
109
|
+
readU8le(): number;
|
|
110
|
+
readF(size: 4 | 8): number;
|
|
111
|
+
readFloat(size: 4 | 8): number;
|
|
112
|
+
readF4be(): number;
|
|
113
|
+
readF8be(): number;
|
|
114
|
+
readF4le(): number;
|
|
115
|
+
readF8le(): number;
|
|
116
|
+
readBitsBoolean(n: number): boolean;
|
|
117
|
+
readB(n: number): number;
|
|
118
|
+
readBits(n: number): number;
|
|
119
|
+
readBoolean(n: number): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Read n bits as unsigned integer
|
|
122
|
+
* @param n
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
readBitsInt(n: number): number;
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @param len number of bytes(s) to read. If value is < 0, read until up to buffer position 'size - |len|'
|
|
129
|
+
*/
|
|
130
|
+
readBytes(len?: number): Uint8Array;
|
|
131
|
+
/**
|
|
132
|
+
* Read all remaining bytes in buffer
|
|
133
|
+
*/
|
|
134
|
+
readBytesFull(): Uint8Array<ArrayBuffer>;
|
|
135
|
+
/**
|
|
136
|
+
* Read bytes until terminator value is found
|
|
137
|
+
* @throws if eosError is set to true and terminator is not found
|
|
138
|
+
*
|
|
139
|
+
* @param terminator value to search for
|
|
140
|
+
* @param include true to include terminator to result
|
|
141
|
+
* @param consume true to consume terminator
|
|
142
|
+
* @param eosError true to throw an error if we reach end of stream
|
|
143
|
+
*/
|
|
144
|
+
readBytesTerm(terminator: number, { include, consume, eosError, }?: {
|
|
145
|
+
include?: boolean;
|
|
146
|
+
consume?: boolean;
|
|
147
|
+
eosError?: boolean;
|
|
148
|
+
}): Uint8Array<ArrayBuffer>;
|
|
149
|
+
/**
|
|
150
|
+
* Ensure that the next stream bytes are the one expected
|
|
151
|
+
* @param expected expected content to check
|
|
152
|
+
* @throws UnexpectedDataError is not the expected bytes
|
|
153
|
+
*/
|
|
154
|
+
ensureFixedContents(expected: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
155
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { KaitaiStream, StreamBufferType } from './kaitai-stream';
|
|
2
|
+
export declare class KaitaiStreamWriter extends KaitaiStream {
|
|
3
|
+
options: {
|
|
4
|
+
/**
|
|
5
|
+
* True to check that value we are trying to write fit the available size.
|
|
6
|
+
* For example it will throw an error if trying to write 0xFFFF on 1 byte.
|
|
7
|
+
*/
|
|
8
|
+
checkValueSize: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @param arrayBuffer ArrayBuffer to read from.
|
|
12
|
+
* @param byteOffset Offset from arrayBuffer beginning for the KaitaiStream.
|
|
13
|
+
*/
|
|
14
|
+
constructor(arrayBuffer?: StreamBufferType, byteOffset?: number, isBigEndian?: boolean, options?: {
|
|
15
|
+
/**
|
|
16
|
+
* True to check that value we are trying to write fit the available size.
|
|
17
|
+
* For example it will throw an error if trying to write 0xFFFF on 1 byte.
|
|
18
|
+
*/
|
|
19
|
+
checkValueSize: boolean;
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Utility function to merge byte arrays
|
|
23
|
+
* @param data
|
|
24
|
+
*/
|
|
25
|
+
static mergeArrays(...data: Uint8Array[]): Uint8Array<ArrayBuffer>;
|
|
26
|
+
static create(size: number): KaitaiStreamWriter;
|
|
27
|
+
get toBytes(): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param value
|
|
31
|
+
* @param type
|
|
32
|
+
* @param size size in bits
|
|
33
|
+
*/
|
|
34
|
+
write(value: number | boolean, type: 'f' | 'u' | 's' | 'b', size: number): any;
|
|
35
|
+
/**
|
|
36
|
+
* Append value on 1 byte
|
|
37
|
+
* @param value
|
|
38
|
+
*/
|
|
39
|
+
writeByte(value: number): this;
|
|
40
|
+
writeU(value: number, byteSize: number): this;
|
|
41
|
+
writeF(value: any, byteSize: number): this;
|
|
42
|
+
writeS(value: any, byteSize: number): this;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated flush bit calls are now useless
|
|
45
|
+
* @param v
|
|
46
|
+
*/
|
|
47
|
+
flushBits(): void;
|
|
48
|
+
private _setBitsAtCurrentPosition;
|
|
49
|
+
_setBit(value: boolean): this;
|
|
50
|
+
/**
|
|
51
|
+
* Write bit per bit
|
|
52
|
+
* @param v
|
|
53
|
+
* @param n
|
|
54
|
+
*/
|
|
55
|
+
writeB(v: number | boolean, n?: number): this;
|
|
56
|
+
forwardBit(): void;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param v true or false
|
|
60
|
+
* @param n number of bits
|
|
61
|
+
*/
|
|
62
|
+
writeBitsBoolean(v: boolean, n: number): this;
|
|
63
|
+
/**
|
|
64
|
+
* Append given bytes to stream
|
|
65
|
+
* @param data
|
|
66
|
+
* @param size
|
|
67
|
+
*/
|
|
68
|
+
writeBytes(data: Uint8Array, size?: number): this;
|
|
69
|
+
/**
|
|
70
|
+
* Check that buffer size has enaugh room to add the byteSize bytes
|
|
71
|
+
* Will resize buffer if not
|
|
72
|
+
* @param byteSize
|
|
73
|
+
*/
|
|
74
|
+
private _checkSize;
|
|
75
|
+
resize(newSize: number): void;
|
|
76
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
export type StreamBufferType = ArrayBufferLike | DataView;
|
|
2
|
+
/**
|
|
3
|
+
* KaitaiStream is an implementation of Kaitai Struct API for JavaScript.
|
|
4
|
+
*
|
|
5
|
+
* It's based on KaitaiStream.js - https://github.com/kaitai-io/kaitai_struct_javascript_runtime/blob/master/KaitaiStream.js that comes with the following license
|
|
6
|
+
*
|
|
7
|
+
* @license Copyright 2012-2016 Ilmari Heikkinen Copyright 2016-2020 Kaitai Project licensed under Apache License, Version 2.0 (the "License");
|
|
8
|
+
*
|
|
9
|
+
* Implementation has been translated to Typescript and modified to fit our needs
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class KaitaiStream {
|
|
12
|
+
/**
|
|
13
|
+
* @param arrayBuffer ArrayBuffer to read from.
|
|
14
|
+
* @param byteOffset Offset from arrayBuffer beginning for the KaitaiStream.
|
|
15
|
+
* @param isBigEndian
|
|
16
|
+
*/
|
|
17
|
+
constructor(arrayBuffer?: StreamBufferType, byteOffset?: number, isBigEndian?: boolean);
|
|
18
|
+
get byteLeft(): number;
|
|
19
|
+
set pos(v: number);
|
|
20
|
+
get pos(): number;
|
|
21
|
+
/**
|
|
22
|
+
Set/get the backing ArrayBuffer of the KaitaiStream object.
|
|
23
|
+
The setter updates the DataView to point to the new buffer.
|
|
24
|
+
@type {Object}
|
|
25
|
+
*/
|
|
26
|
+
get buffer(): ArrayBufferLike;
|
|
27
|
+
get toBytes(): Uint8Array;
|
|
28
|
+
set buffer(v: ArrayBuffer);
|
|
29
|
+
get isBigEndian(): boolean;
|
|
30
|
+
get isLittleEndian(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
Set/get the byteOffset of the KaitaiStream object.
|
|
33
|
+
The setter updates the DataView to point to the new byteOffset.
|
|
34
|
+
@type {number}
|
|
35
|
+
*/
|
|
36
|
+
get byteOffset(): number;
|
|
37
|
+
set byteOffset(v: number);
|
|
38
|
+
/**
|
|
39
|
+
Set/get the backing DataView of the KaitaiStream object.
|
|
40
|
+
The setter updates the buffer and byteOffset to point to the DataView values.
|
|
41
|
+
@type {Object}
|
|
42
|
+
*/
|
|
43
|
+
get dataView(): DataView<ArrayBuffer>;
|
|
44
|
+
set dataView(v: DataView<ArrayBuffer>);
|
|
45
|
+
/**
|
|
46
|
+
Returns the byte length of the KaitaiStream object.
|
|
47
|
+
@type {number}
|
|
48
|
+
*/
|
|
49
|
+
get size(): number;
|
|
50
|
+
static iconvlite: any;
|
|
51
|
+
static zlib: any;
|
|
52
|
+
/**
|
|
53
|
+
Dependency configuration data. Holds urls for (optional) dynamic loading
|
|
54
|
+
of code dependencies from a remote server. For use by (static) processing functions.
|
|
55
|
+
Caller should the supported keys to the asset urls as needed.
|
|
56
|
+
NOTE: `depUrls` is a static property of KaitaiStream (the factory),like the various
|
|
57
|
+
processing functions. It is NOT part of the prototype of instances.
|
|
58
|
+
@type {Object}
|
|
59
|
+
*/
|
|
60
|
+
static depUrls: {
|
|
61
|
+
zlib: any | undefined;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
Native endianness. Either KaitaiStream.BIG_ENDIAN or KaitaiStream.LITTLE_ENDIAN
|
|
65
|
+
depending on the platform endianness.
|
|
66
|
+
@type {boolean}
|
|
67
|
+
*/
|
|
68
|
+
static endianness: boolean;
|
|
69
|
+
protected _byteOffset: number;
|
|
70
|
+
protected _buffer: ArrayBufferLike;
|
|
71
|
+
protected _dataView: DataView;
|
|
72
|
+
protected _pos: number;
|
|
73
|
+
protected _bitsLeft: number;
|
|
74
|
+
/**
|
|
75
|
+
* Number of bits left to read/write for the current byte (when read bit by bit instead of bytes)
|
|
76
|
+
* Number between 8 and 1
|
|
77
|
+
* @deprecated
|
|
78
|
+
*/
|
|
79
|
+
get bitsLeft(): number;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated will be removed in future release
|
|
82
|
+
*/
|
|
83
|
+
get bits(): number;
|
|
84
|
+
/**
|
|
85
|
+
Virtual byte length of the KaitaiStream backing buffer.
|
|
86
|
+
Updated to be max of original buffer size and last written size.
|
|
87
|
+
If dynamicSize is false is set to buffer size.
|
|
88
|
+
@type {number}
|
|
89
|
+
*/
|
|
90
|
+
_byteLength: number;
|
|
91
|
+
_isBigEndian: boolean;
|
|
92
|
+
static bytesStripRight(data: Uint8Array, padByte: number): Uint8Array<ArrayBuffer>;
|
|
93
|
+
static bytesTerminate(data: Uint8Array, term: number, include?: boolean): Uint8Array<ArrayBuffer>;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated will be removed in future major release
|
|
96
|
+
* @param arr
|
|
97
|
+
* @param encoding
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
static bytesToStr(arr: Uint8Array, encoding: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated
|
|
103
|
+
* @param a
|
|
104
|
+
* @param b
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
107
|
+
static mod(a: number, b: number): number;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated
|
|
110
|
+
* @param a
|
|
111
|
+
* @param b
|
|
112
|
+
* @returns
|
|
113
|
+
*/
|
|
114
|
+
static arrayMin(arr: Uint8Array): number;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated
|
|
117
|
+
* @param a
|
|
118
|
+
* @param b
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
static arrayMax(arr: Uint8Array): number;
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated
|
|
124
|
+
* @param a
|
|
125
|
+
* @param b
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
static byteArrayCompare(a: Uint8Array, b: Uint8Array): number;
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated
|
|
131
|
+
* Creates an array from an array of character codes.
|
|
132
|
+
Uses String.fromCharCode in chunks for memory efficiency and then concatenates
|
|
133
|
+
the resulting string chunks.
|
|
134
|
+
@param {array} array Array of character codes.
|
|
135
|
+
@return {string} String created from the character codes.
|
|
136
|
+
*/
|
|
137
|
+
static createStringFromArray(array: any): string;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated
|
|
140
|
+
* @param data
|
|
141
|
+
* @param key
|
|
142
|
+
* @returns
|
|
143
|
+
*/
|
|
144
|
+
static processXorOne(data: Uint8Array, key: number): Uint8Array<ArrayBuffer>;
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated
|
|
147
|
+
* @param data
|
|
148
|
+
* @param key
|
|
149
|
+
* @returns
|
|
150
|
+
*/
|
|
151
|
+
static processXorMany(data: Uint8Array, key: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated
|
|
154
|
+
* @param data
|
|
155
|
+
* @param amount
|
|
156
|
+
* @param groupSize
|
|
157
|
+
* @returns
|
|
158
|
+
*/
|
|
159
|
+
static processRotateLeft(data: Uint8Array, amount: number, groupSize: number): Uint8Array<ArrayBuffer>;
|
|
160
|
+
getStreamSize(): number;
|
|
161
|
+
alignToByte(): void;
|
|
162
|
+
protected _getBitsFromCurrentPosition(): number;
|
|
163
|
+
protected _decreaseBitsLeft(val: number): void;
|
|
164
|
+
/**
|
|
165
|
+
Internal function to trim the KaitaiStream buffer when required.
|
|
166
|
+
Used for stripping out the extra bytes from the backing buffer when
|
|
167
|
+
the virtual byteLength is smaller than the buffer byteLength (happens after
|
|
168
|
+
growing the buffer with writes and not filling the extra space completely).
|
|
169
|
+
@return {null}
|
|
170
|
+
*/
|
|
171
|
+
_trimAlloc(): void;
|
|
172
|
+
/**
|
|
173
|
+
Returns true if the KaitaiStream seek pointer is at the end of buffer and
|
|
174
|
+
there's no more data to read.
|
|
175
|
+
@return {boolean} True if the seek pointer is at the end of the buffer.
|
|
176
|
+
*/
|
|
177
|
+
isEof(): boolean;
|
|
178
|
+
forward(relativePosition: number): this;
|
|
179
|
+
/**
|
|
180
|
+
Sets the KaitaiStream read/write position to given position.
|
|
181
|
+
Clamps between 0 and KaitaiStream length.
|
|
182
|
+
@param {number} pos Position to seek to.
|
|
183
|
+
@return {null}
|
|
184
|
+
*/
|
|
185
|
+
seek(pos: number): void;
|
|
186
|
+
forwardBits(n: number): this;
|
|
187
|
+
setBitPosition(bitPosition: number): void;
|
|
188
|
+
getBitPosition(): number;
|
|
189
|
+
/**
|
|
190
|
+
Maps a Uint8Array into the KaitaiStream buffer.
|
|
191
|
+
Nice for quickly reading in data.
|
|
192
|
+
@param {number} length Number of elements to map.
|
|
193
|
+
@return {Object} Uint8Array to the KaitaiStream backing buffer.
|
|
194
|
+
*/
|
|
195
|
+
mapUint8Array(length: number): Uint8Array;
|
|
196
|
+
}
|
|
197
|
+
export declare class EOFError extends Error {
|
|
198
|
+
bytesReq: number;
|
|
199
|
+
bytesAvail: number;
|
|
200
|
+
constructor(bytesReq: number, bytesAvail: number);
|
|
201
|
+
}
|
|
202
|
+
export declare class UnexpectedDataError extends Error {
|
|
203
|
+
expected: Uint8Array;
|
|
204
|
+
actual: Uint8Array;
|
|
205
|
+
constructor(expected: Uint8Array, actual: Uint8Array);
|
|
206
|
+
}
|
|
207
|
+
export declare class UndecidedEndiannessError extends Error {
|
|
208
|
+
constructor();
|
|
209
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bit wise & operator that works with number > 32bits
|
|
3
|
+
*
|
|
4
|
+
* @param v1
|
|
5
|
+
* @param v2
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function bitWiseAnd(v1: number, v2: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Bit wise | operator that works with number > 32bits
|
|
11
|
+
*
|
|
12
|
+
* @param v1
|
|
13
|
+
* @param v2
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function bitWiseOr(v1: number, v2: number): number;
|