From 96fa07adec8b0ae05e07c2c40383267f25f2fc92 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Fri, 2 Dec 2016 13:22:06 +0100 Subject: [PATCH] Use long.js dependency in tests, reference types instead of paths in .d.ts see #503 --- .zuul.yml | 1 + dist/protobuf.js | 2 +- dist/protobuf.min.js | 2 +- dist/protobuf.min.js.gz | Bin 15763 -> 15763 bytes scripts/types.js | 4 +- types/protobuf.js.d.ts | 102 ++++++++++++++-------------------------- 6 files changed, 41 insertions(+), 70 deletions(-) diff --git a/.zuul.yml b/.zuul.yml index 829222b19..ad2be6684 100644 --- a/.zuul.yml +++ b/.zuul.yml @@ -18,6 +18,7 @@ browsers: version: [8.1, 9.0, latest] scripts: - scripts/polyfill.js + - node_modules/long/dist/long.js tunnel: type: ngrok proto: tcp diff --git a/dist/protobuf.js b/dist/protobuf.js index 6f810d7f4..a35d17a78 100644 --- a/dist/protobuf.js +++ b/dist/protobuf.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.0.1 (c) 2016 Daniel Wirtz - * Compiled Fri, 02 Dec 2016 11:19:57 UTC + * Compiled Fri, 02 Dec 2016 12:20:41 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/protobuf.min.js b/dist/protobuf.min.js index d0819e3a4..5488b4e34 100644 --- a/dist/protobuf.min.js +++ b/dist/protobuf.min.js @@ -1,6 +1,6 @@ /*! * protobuf.js v6.0.1 (c) 2016 Daniel Wirtz - * Compiled Fri, 02 Dec 2016 11:19:57 UTC + * Compiled Fri, 02 Dec 2016 12:20:41 UTC * Licensed under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/protobuf.js for details */ diff --git a/dist/protobuf.min.js.gz b/dist/protobuf.min.js.gz index 9dfc131567aebf81c84b85b06fc4f7c721bb0bdb..f1a68749d7630cf51a9121ef7766f0d36112bd9d 100644 GIT binary patch delta 532 zcmV+v0_**gdy{*Rk$;7~PI%aD{Pg}SEcrSa^R$4H%XGr?Mmgh+SBrQIe`F48{LJ$r z${K-Nbn#jyzS=i+`f>Zo#u@Bj^8FCOL05 zCM+3o363FS%k1h_x#f$ z%gZ9XU$6T(hJRsa)E>w4xj$>mET%@|b1}dqqJrJgkdOKj)Z9-7NyvjWn=w<9Gl9Fc zEQMXF%r&6g$L5Ns;EQEZr=Ojr?Kw{`%UM5bwSwGF5$PI)wSV6YhXz{g944oo^LP@u z$t-2L7)-%nGNaQM`Chu$WpU(p&(4+sd`_eI{JhI%(SP0vn@7o@6XuXQhOcf2ACrg= z%hr6<$6?G{(U=v{q=~inW>|f4eje=sE?UvDKRfUAi>P;W{Gw=yT8wJU_M+2(8pxu; zs$1x~Db>xWZdOwlsHGD{Q4thTcW>I~^MWHa7LcYXD;vCt--P~Tu-6T{!3)2;4z`T|Fkn* zrsEPD<9^8!mIn7aCHFJ74DOSuzmp8Jk@za<>n6?{apb9@UVjvocMG0P8#({aGRb+f zDL?vHXW4AVLC(u%o;G4=bf*(wdZE$^nTD-Sqmuj=| z^Tw{%%39v87xc?np4~R4Z5(CfegF3BpI(3S>zlXlfBp9DPj9~V*mRBU%_4+7y62x3 zSzZ?5{d(QUF@Fp@qxLwS&;40jW-&DypNjz|5f$u?hJ4hQpyqxuNJ1X0*^HT*oC(~m zWhv}ZWv&6`J~mf81z#+SI{oY{ZO?gnS-A;By+q=jUBEi+}b`*gQ%GoiK;gF?@AH_?Sd| zShnV)J`Q8vipH#nCQYopH^b_a^YdsAaM6mE{n>e^Uqrp5;}=Cs)M8X)wilfS)Ib&$ zR^39^O{s21b+ekfKrNjpii)6!x_i?;pBEgdv4Av9S=r!C{3i4#gFRSL!3)2;4', - '/// ', + '/// ', + '/// ', "", "/*", " * protobuf.js v" + pkg.version + " TypeScript definitions", diff --git a/types/protobuf.js.d.ts b/types/protobuf.js.d.ts index b8765c61d..803ad9203 100644 --- a/types/protobuf.js.d.ts +++ b/types/protobuf.js.d.ts @@ -1,9 +1,9 @@ -/// -/// +/// +/// /* * protobuf.js v6.0.1 TypeScript definitions - * Generated Thu, 01 Dec 2016 15:54:46 UTC + * Generated Fri, 02 Dec 2016 12:20:52 UTC */ declare module protobuf { @@ -1619,6 +1619,29 @@ declare module protobuf { */ var Long: (() => any); + /** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ + function longToHash(value: (Long|number)): string; + + /** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ + function longFromHash(hash: string, unsigned?: boolean): (Long|number); + + /** + * Tests if two possibly long values are not equal. + * @param {number|Long} a First value + * @param {number|Long} b Second value + * @returns {boolean} `true` if not equal + */ + function longNeq(a: (number|Long), b: (number|Long)): boolean; + /** * Tests if the specified value is a string. * @memberof util @@ -1693,29 +1716,6 @@ declare module protobuf { */ function resolvePath(originPath: string, importPath: string, alreadyNormalized?: boolean): string; - /** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ - function longToHash(value: (Long|number)): string; - - /** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ - function longFromHash(hash: string, unsigned?: boolean): (Long|number); - - /** - * Tests if two possibly long values are not equal. - * @param {number|Long} a First value - * @param {number|Long} b Second value - * @returns {boolean} `true` if not equal - */ - function longNeq(a: (number|Long), b: (number|Long)): boolean; - /** * Merges the properties of the source object into the destination object. * @param {Object} dst Destination object @@ -1742,54 +1742,24 @@ declare module protobuf { } /** - * Constructs a new verifier for the specified message type. - * @classdesc Runtime message verifier using code generation on top of reflection. - * @constructor - * @param {Type} type Message type + * Runtime message verifier using code generation on top of reflection. + * @namespace */ - class Verifier { - /** - * Constructs a new verifier for the specified message type. - * @classdesc Runtime message verifier using code generation on top of reflection. - * @constructor - * @param {Type} type Message type - */ - constructor(type: Type); - - /** - * Message type. - * @type {Type} - */ - type: Type; - - /** - * Fields of this verifier's message type as an array for iteration. - * @name Verifier#fieldsArray - * @type {Field[]} - * @readonly - */ - fieldsArray: Field[]; - - /** - * Full name of this verifier's message type. - * @name Verifier#fullName - * @type {string} - * @readonly - */ - fullName: string; - + module verifier { /** - * Verifies a runtime message of this verifier's message type. + * Verifies a runtime message of `this` message type. * @param {Prototype|Object} message Runtime message or plain object to verify * @returns {?string} `null` if valid, otherwise the reason why it is not + * @this {Type} */ - verify(message: (Prototype|Object)): string; + function fallback(message: (Prototype|Object)): string; /** - * Generates a verifier specific to this verifier's message type. - * @returns {function} Verifier function with an identical signature to {@link Verifier#verify} + * Generates a verifier specific to the specified message type. + * @param {Type} mtype Message type + * @returns {util.CodegenAppender} Unscoped codegen instance */ - generate(): (() => any); + function generate(mtype: Type): util.CodegenAppender; }