Skip to content

Commit

Permalink
Updated docs and types [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 16, 2016
1 parent 1a6fdc9 commit 3cb1b7e
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 17 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,21 @@ Consolidates imports and converts between file formats.
-o, --out Saves to a file instead of writing to stdout.
-w, --wrap Specifies the wrapper to use for *-module targets. Also accepts a path.
Module targets only:
-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.
default Default wrapper supporting both CommonJS and AMD
commonjs CommonJS only wrapper
amd AMD only wrapper
-r, --root Specifies an alternative protobuf.roots name for *-module targets.
-r, --root Specifies an alternative protobuf.roots name.
Proto sources only:
--keep-case Keeps field casing instead of converting to camel case (not recommended).
Static code generation only:
Static targets only:
--no-encode Does not generate encode functions.
--no-decode Does not generate decode functions.
Expand Down
16 changes: 13 additions & 3 deletions dist/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/protobuf.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/protobuf.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/runtime/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/runtime/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/runtime/protobuf.min.js.gz
Binary file not shown.
14 changes: 12 additions & 2 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function lower(token) {
*/

/**
* Options modifying the the behavior of {@link parse}.
* Options modifying the behavior of {@link parse}.
* @typedef ParseOptions
* @type {Object}
* @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case
Expand All @@ -43,7 +43,7 @@ function lower(token) {
/**
* Parses the given .proto source and returns an object with the parsed contents.
* @param {string} source Source contents
* @param {Root|ParseOptions} [root] Root to populate
* @param {Root} root Root to populate
* @param {ParseOptions} [options] Parse options
* @returns {ParserResult} Parser result
*/
Expand Down Expand Up @@ -552,3 +552,13 @@ function parse(source, root, options) {
root : root
};
}

/**
* Parses the given .proto source and returns an object with the parsed contents.
* @name parse
* @function
* @param {string} source Source contents
* @param {ParseOptions} [options] Parse options
* @returns {ParserResult} Parser result
* @variation 2
*/
19 changes: 15 additions & 4 deletions 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 Fri, 16 Dec 2016 14:07:14 UTC
// Generated Fri, 16 Dec 2016 14:38:04 UTC
declare module "protobufjs" {

/**
Expand Down Expand Up @@ -1008,7 +1008,7 @@ declare module "protobufjs" {
}

/**
* Options modifying the the behavior of {@link parse}.
* Options modifying the behavior of {@link parse}.
* @typedef ParseOptions
* @type {Object}
* @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case
Expand All @@ -1020,11 +1020,22 @@ declare module "protobufjs" {
/**
* Parses the given .proto source and returns an object with the parsed contents.
* @param {string} source Source contents
* @param {Root|ParseOptions} [root] Root to populate
* @param {Root} root Root to populate
* @param {ParseOptions} [options] Parse options
* @returns {ParserResult} Parser result
*/
function parse(source: string, root?: (Root|ParseOptions), options?: ParseOptions): ParserResult;
function parse(source: string, root: Root, options?: ParseOptions): ParserResult;

/**
* Parses the given .proto source and returns an object with the parsed contents.
* @name parse
* @function
* @param {string} source Source contents
* @param {ParseOptions} [options] Parse options
* @returns {ParserResult} Parser result
* @variation 2
*/
function parse(source: string, options?: ParseOptions): ParserResult;

/**
* Constructs a new reader instance using the specified buffer.
Expand Down

0 comments on commit 3cb1b7e

Please sign in to comment.