Skip to content

Commit d87978b

Browse files
fix(types): update type deps (protobufjs#1776)
* Update type deps Remove duplicate `long` types * Fix type tests Co-authored-by: Alexander Fenster <fenster@google.com>
1 parent 0f4af83 commit d87978b

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

cli/pbts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ exports.main = function(args, callback) {
144144
var output = [];
145145
if (argv.main)
146146
output.push(
147-
"// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.",
147+
"// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.",
148148
""
149149
);
150150
if (argv.global)

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run types'.
1+
// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.
22

33
export as namespace protobuf;
44

tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ It is essential that tests only use the cross-platform API that is also availabl
55
* Use `load`, not `loadSync`
66
* Use `Reader.create`, not `BufferReader`
77
* Use `Writer.create`, not `BufferWriter`
8-
* It is safe to use `Long`
8+
* It is safe to use `Long`, but TypeScript tests must import the type from `"long"`
99

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

tests/data/mapbox/vector_tile.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as $protobuf from "../../..";
2+
import Long from "long";
3+
24
export namespace vector_tile {
35

46
interface ITile {

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "ES5",
44
"experimentalDecorators": true,
5-
"emitDecoratorMetadata": true
5+
"emitDecoratorMetadata": true,
6+
"esModuleInterop": true,
67
}
78
}

0 commit comments

Comments
 (0)