Skip to content

Commit

Permalink
Fix TS declaration file build errors. Fixes #150 (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbenincasa committed May 23, 2024
1 parent c90afcc commit 22a43b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events'
import workerThreads from 'worker_threads'
import * as workerThreads from 'worker_threads'

interface ThreadStreamOptions {
/**
Expand Down Expand Up @@ -76,9 +76,8 @@ declare class ThreadStream extends EventEmitter {
* @param args the arguments to be passed to the event handlers.
* @returns {boolean} `true` if the event had listeners, `false` otherwise.
*/
emit(eventName: string | symbol, ...args: any[]): boolean {
return super.emit(eventName, ...args);
}
emit(eventName: string | symbol, ...args: any[]): boolean;

/**
* Post a message to the Worker with specified data and an optional list of transferable objects.
*
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"why-is-node-running": "^2.2.2"
},
"scripts": {
"test": "standard && npm run transpile && tap \"test/**/*.test.*js\" && tap --ts test/*.test.*ts",
"build": "tsc --noEmit",
"test": "standard && npm run build && npm run transpile && tap \"test/**/*.test.*js\" && tap --ts test/*.test.*ts",
"test:ci": "standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts",
"test:ci:js": "tap --no-check-coverage --timeout=120 --coverage-report=lcovonly \"test/**/*.test.*js\"",
"test:ci:ts": "tap --ts --no-check-coverage --coverage-report=lcovonly \"test/**/*.test.*ts\"",
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"esModuleInterop": true
},
"files": [
"index.d.ts"
],
}

0 comments on commit 22a43b3

Please sign in to comment.