@platformatic/itc 3.44.0 → 3.46.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.
Files changed (2) hide show
  1. package/lib/index.d.ts +5 -6
  2. package/package.json +3 -6
package/lib/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { EventEmitter } from 'node:events'
2
2
  import { MessagePort } from 'node:worker_threads'
3
3
 
4
- export type Handler = ((data: any) => any) | ((data: any) => Promise<any>)
4
+ export type Handler = (data: any) => any | Promise<any>
5
5
 
6
6
  export interface ITCConstructorOptions {
7
- port: MessagePort
7
+ port: MessagePort,
8
+ name: string,
9
+ handlers?: Record<string, Handler>
10
+ throwOnMissingHandler?: boolean
8
11
  }
9
12
 
10
13
  export class ITC extends EventEmitter {
@@ -17,7 +20,3 @@ export class ITC extends EventEmitter {
17
20
  listen (): void
18
21
  close (): void
19
22
  }
20
-
21
- declare module '@platformatic/itc' {
22
- export { ITC }
23
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/itc",
3
- "version": "3.44.0",
3
+ "version": "3.46.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -20,22 +20,19 @@
20
20
  "cleaner-spec-reporter": "^0.5.0",
21
21
  "eslint": "9",
22
22
  "neostandard": "^0.12.0",
23
- "tsd": "^0.33.0",
23
+ "tstyche": "^6.2.0",
24
24
  "typescript": "^5.5.4"
25
25
  },
26
26
  "dependencies": {
27
27
  "@fastify/error": "^4.0.0",
28
28
  "@watchable/unpromise": "^1.0.2"
29
29
  },
30
- "tsd": {
31
- "directory": "test/types"
32
- },
33
30
  "engines": {
34
31
  "node": ">=22.19.0"
35
32
  },
36
33
  "scripts": {
37
34
  "test": "npm run test:types && node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js",
38
- "test:types": "tsd",
35
+ "test:types": "tstyche",
39
36
  "lint": "eslint"
40
37
  }
41
38
  }