@signalk/assemblyscript-plugin-sdk 0.2.0 → 0.3.0

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/assembly/api.ts CHANGED
@@ -17,7 +17,11 @@ import { Delta } from './signalk'
17
17
  * @param version - Signal K version: 0 = v1 (default), 1 = v2
18
18
  */
19
19
  @external("env", "sk_handle_message")
20
- declare function sk_handle_message_ffi(deltaPtr: usize, deltaLen: usize, version: i32): void
20
+ declare function sk_handle_message_ffi(
21
+ deltaPtr: usize,
22
+ deltaLen: usize,
23
+ version: i32
24
+ ): void
21
25
 
22
26
  /**
23
27
  * @internal
@@ -223,12 +227,7 @@ export function getPath(path: string): string | null {
223
227
  const resultBuffer = new ArrayBuffer(1024)
224
228
  const resultPtr = changetype<usize>(resultBuffer)
225
229
 
226
- const len = sk_get_path_ffi(
227
- pathPtr,
228
- pathBuffer.byteLength,
229
- resultPtr,
230
- 1024
231
- )
230
+ const len = sk_get_path_ffi(pathPtr, pathBuffer.byteLength, resultPtr, 1024)
232
231
 
233
232
  if (len === 0) {
234
233
  return null
@@ -13,7 +13,10 @@ import { JSON } from 'assemblyscript-json/assembly'
13
13
  * Register this plugin as a resource provider for a given type
14
14
  */
15
15
  @external("env", "sk_register_resource_provider")
16
- declare function sk_register_resource_provider_ffi(typePtr: usize, typeLen: usize): i32
16
+ declare function sk_register_resource_provider_ffi(
17
+ typePtr: usize,
18
+ typeLen: usize
19
+ ): i32
17
20
 
18
21
  // ===== Public API Functions =====
19
22
 
@@ -112,7 +115,7 @@ export class ResourceGetRequest {
112
115
  */
113
116
  export class ResourceSetRequest {
114
117
  id: string = ''
115
- value: string = '{}' // JSON string of the value
118
+ value: string = '{}' // JSON string of the value
116
119
 
117
120
  static parse(jsonStr: string): ResourceSetRequest {
118
121
  const req = new ResourceSetRequest()
@@ -123,7 +123,8 @@ export class Notification {
123
123
  let methodStr = '['
124
124
  for (let i = 0; i < this.method.length; i++) {
125
125
  if (i > 0) methodStr += ','
126
- methodStr += this.method[i] == NotificationMethod.visual ? '"visual"' : '"sound"'
126
+ methodStr +=
127
+ this.method[i] == NotificationMethod.visual ? '"visual"' : '"sound"'
127
128
  }
128
129
  methodStr += ']'
129
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/assemblyscript-plugin-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "AssemblyScript SDK for developing Signal K WASM plugins",
5
5
  "main": "assembly/index.ts",
6
6
  "types": "index.d.ts",
@@ -33,11 +33,11 @@
33
33
  "test": "npm run asbuild:debug"
34
34
  },
35
35
  "devDependencies": {
36
- "assemblyscript": "^0.27.0"
36
+ "assemblyscript": "^0.27.37"
37
37
  },
38
38
  "dependencies": {
39
- "as-wasi": "^0.6.0",
40
39
  "as-fetch": "^2.1.4",
40
+ "as-wasi": "^0.6.0",
41
41
  "assemblyscript-json": "^1.1.0"
42
42
  },
43
43
  "repository": {