File tree Expand file tree Collapse file tree 5 files changed +70
-0
lines changed
Expand file tree Collapse file tree 5 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ *
2+ ! ** /* .d.ts
3+ ! ** /* .d.cts
4+ ! ** /* .d.mts
5+ ! ** /* .d. * .ts
Original file line number Diff line number Diff line change 1+ /// <reference types="node" />
2+ interface KafkaJSSnappyCodec {
3+ compress : ( encoder : { buffer : Buffer } ) => Promise < Buffer > ;
4+ decompress : ( buffer : Buffer ) => Promise < Buffer > ;
5+ }
6+
7+ declare function KafkaJSSnappy ( ) : KafkaJSSnappyCodec ;
8+
9+ export = KafkaJSSnappy ;
Original file line number Diff line number Diff line change 1+ import KafkaJSSnappy from "kafkajs-snappy" ;
2+
3+ const codec = KafkaJSSnappy ( ) ;
4+
5+ const buffer = Buffer . alloc ( 100 ) ;
6+
7+ // @ts -expect-error Missing arg
8+ codec . compress ( ) ;
9+ // @ts -expect-error Invalid arg
10+ codec . compress ( [ ] ) ;
11+ codec . compress ( { buffer : buffer } ) ; // $ExpectType Promise<Buffer> || Promise<Buffer<ArrayBufferLike>>
12+
13+ // @ts -expect-error Missing arg
14+ codec . decompress ( ) ;
15+ // @ts -expect-error Invalid arg
16+ codec . decompress ( [ ] ) ;
17+ codec . decompress ( buffer ) ; // $ExpectType Promise<Buffer> || Promise<Buffer<ArrayBufferLike>>
Original file line number Diff line number Diff line change 1+ {
2+ "private" : true ,
3+ "name" : " @types/kafkajs-snappy" ,
4+ "version" : " 1.0.9999" ,
5+ "projects" : [
6+ " https://github.com/tulios/kafkajs-snappy"
7+ ],
8+ "dependencies" : {
9+ "@types/node" : " *"
10+ },
11+ "devDependencies" : {
12+ "@types/kafkajs-snappy" : " workspace:."
13+ },
14+ "owners" : [
15+ {
16+ "name" : " Matteo Di Sabatino" ,
17+ "githubUsername" : " matteodisabatino"
18+ }
19+ ]
20+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "module" : " node16" ,
4+ "lib" : [
5+ " es6"
6+ ],
7+ "noImplicitAny" : true ,
8+ "noImplicitThis" : true ,
9+ "strictFunctionTypes" : true ,
10+ "strictNullChecks" : true ,
11+ "types" : [],
12+ "noEmit" : true ,
13+ "forceConsistentCasingInFileNames" : true
14+ },
15+ "files" : [
16+ " index.d.ts" ,
17+ " kafkajs-snappy-tests.ts"
18+ ]
19+ }
You can’t perform that action at this time.
0 commit comments