protobufjs 6.9.0 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/cli/package.json +7 -1
- package/cli/pbjs.js +2 -3
- package/dist/light/protobuf.js +149 -24
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +4 -4
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +201 -44
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/index.d.ts +32 -0
- package/package-lock.json +649 -233
- package/package.json +7 -7
- package/src/decoder.js +37 -15
- package/src/object.js +43 -0
- package/src/parse.js +37 -11
- package/src/root.js +11 -1
- package/src/tokenize.js +15 -9
- package/src/util/minimal.js +2 -2
- package/src/util.js +31 -0
- package/src/wrappers.js +23 -4
package/index.d.ts
CHANGED
|
@@ -859,6 +859,9 @@ export abstract class ReflectionObject {
|
|
|
859
859
|
/** Options. */
|
|
860
860
|
public options?: { [k: string]: any };
|
|
861
861
|
|
|
862
|
+
/** Parsed Options. */
|
|
863
|
+
public parsedOptions?: { [k: string]: any[] };
|
|
864
|
+
|
|
862
865
|
/** Unique name within its namespace. */
|
|
863
866
|
public name: string;
|
|
864
867
|
|
|
@@ -920,6 +923,15 @@ export abstract class ReflectionObject {
|
|
|
920
923
|
*/
|
|
921
924
|
public setOption(name: string, value: any, ifNotSet?: boolean): ReflectionObject;
|
|
922
925
|
|
|
926
|
+
/**
|
|
927
|
+
* Sets a parsed option.
|
|
928
|
+
* @param name parsed Option name
|
|
929
|
+
* @param value Option value
|
|
930
|
+
* @param propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value
|
|
931
|
+
* @returns `this`
|
|
932
|
+
*/
|
|
933
|
+
public setParsedOption(name: string, value: any, propName: string): ReflectionObject;
|
|
934
|
+
|
|
923
935
|
/**
|
|
924
936
|
* Sets multiple options.
|
|
925
937
|
* @param options Options to set
|
|
@@ -1046,6 +1058,9 @@ export interface IParseOptions {
|
|
|
1046
1058
|
|
|
1047
1059
|
/** Recognize double-slash comments in addition to doc-block comments. */
|
|
1048
1060
|
alternateCommentMode?: boolean;
|
|
1061
|
+
|
|
1062
|
+
/** Use trailing comment when both leading comment and trailing comment exist. */
|
|
1063
|
+
preferTrailingComment?: boolean;
|
|
1049
1064
|
}
|
|
1050
1065
|
|
|
1051
1066
|
/** Options modifying the behavior of JSON serialization. */
|
|
@@ -1243,6 +1258,14 @@ export class Root extends NamespaceBase {
|
|
|
1243
1258
|
*/
|
|
1244
1259
|
public resolvePath(origin: string, target: string): (string|null);
|
|
1245
1260
|
|
|
1261
|
+
/**
|
|
1262
|
+
* Fetch content from file path or url
|
|
1263
|
+
* This method exists so you can override it with your own logic.
|
|
1264
|
+
* @param path File path or url
|
|
1265
|
+
* @param callback Callback function
|
|
1266
|
+
*/
|
|
1267
|
+
public fetch(path: string, callback: FetchCallback): void;
|
|
1268
|
+
|
|
1246
1269
|
/**
|
|
1247
1270
|
* Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.
|
|
1248
1271
|
* @param filename Names of one or multiple files to load
|
|
@@ -2151,6 +2174,15 @@ export namespace util {
|
|
|
2151
2174
|
*/
|
|
2152
2175
|
function decorateEnum(object: object): Enum;
|
|
2153
2176
|
|
|
2177
|
+
/**
|
|
2178
|
+
* Sets the value of a property by property path. If a value already exists, it is turned to an array
|
|
2179
|
+
* @param dst Destination object
|
|
2180
|
+
* @param path dot '.' delimited path of the property to set
|
|
2181
|
+
* @param value the value to set
|
|
2182
|
+
* @returns Destination object
|
|
2183
|
+
*/
|
|
2184
|
+
function setProperty(dst: { [k: string]: any }, path: string, value: object): { [k: string]: any };
|
|
2185
|
+
|
|
2154
2186
|
/** Decorator root (TypeScript). */
|
|
2155
2187
|
let decorateRoot: Root;
|
|
2156
2188
|
|