$ npm install
$ npx tsc
index.ts:3:24 - error TS2507: Type '{ default: DuplexifyConstructor; obj(writable?: Writable | undefined, readable?: Readable | undefined, streamOptions?: DuplexOptions | undefined): Duplexify; }' is not a constructor function type.
3 class MyDuplex extends Duplexify {}
~~~~~~~~~
Found 1 error.
Last active
March 14, 2019 05:22
-
-
Save callmehiphop/baa12c5f1fcd3c00cb1caab23a3a02e5 to your computer and use it in GitHub Desktop.
duplexify ts subclass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Duplexify from 'duplexify'; | |
class MyDuplex extends Duplexify {} | |
console.log(new MyDuplex()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dependencies": { | |
"@types/duplexify": "^3.6.0", | |
"duplexify": "^4.0.0", | |
"typescript": "^3.3.3333" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"module": "commonjs", | |
"outDir": "./build", | |
"rootDir": "./", | |
"strict": true, | |
"types": ["node"], | |
"esModuleInterop": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment