Skip to content

Commit

Permalink
Other: Reference dependencies as imports in generated typescript defi…
Browse files Browse the repository at this point in the history
…nitions, see #596
  • Loading branch information
dcodeIO committed Dec 30, 2016
1 parent 3bab132 commit c0ab94c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ exports.main = function(args, callback) {

var output = [
"// $> pbts " + process.argv.slice(2).join(' '),
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
].join('\n') + "\n" + out.join('');
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC")
];
if (argv.name !== "protobufjs")
output.push(
"",
"import { Reader, Writer } from \"protobufjs\";",
""
);
output = output.join('\n') + "\n" + out.join('');

try {
if (argv.out)
Expand Down
2 changes: 1 addition & 1 deletion types/protobuf.js.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// $> pbts --name protobufjs --out types/protobuf.js.d.ts src
// Generated Thu, 29 Dec 2016 16:24:14 UTC
// Generated Fri, 30 Dec 2016 00:51:27 UTC
declare module "protobufjs" {

/**
Expand Down

0 comments on commit c0ab94c

Please sign in to comment.