Skip to content

Commit

Permalink
fix(types): update type deps (#1776)
Browse files Browse the repository at this point in the history
* Update type deps

Remove duplicate `long` types

* Fix type tests

Co-authored-by: Alexander Fenster <[email protected]>
  • Loading branch information
thw0rted and alexander-fenster authored Aug 17, 2022
1 parent 0f4af83 commit d87978b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ exports.main = function(args, callback) {
var output = [];
if (argv.main)
output.push(
"// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.",
"// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.",
""
);
if (argv.global)
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.
// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.

export as namespace protobuf;

Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It is essential that tests only use the cross-platform API that is also availabl
* Use `load`, not `loadSync`
* Use `Reader.create`, not `BufferReader`
* Use `Writer.create`, not `BufferWriter`
* It is safe to use `Long`
* It is safe to use `Long`, but TypeScript tests must import the type from `"long"`

If it's absolutely inevitable for your test case to use node-specific features, you can still use this pattern:

Expand Down
2 changes: 2 additions & 0 deletions tests/data/mapbox/vector_tile.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as $protobuf from "../../..";
import Long from "long";

export namespace vector_tile {

interface ITile {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "ES5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
"emitDecoratorMetadata": true,
"esModuleInterop": true,
}
}

0 comments on commit d87978b

Please sign in to comment.