long.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. /*
  2. * Copyright 2012 The Closure Compiler Authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * @fileoverview Externs for Long.js.
  18. * @see https://github.com/dcodeIO/Long.js
  19. * @externs
  20. */
  21. /**
  22. BEGIN_NODE_INCLUDE
  23. var Long = require('long');
  24. END_NODE_INCLUDE
  25. */
  26. /**
  27. * @param {number|!{low: number, high: number, unsigned: boolean}} low
  28. * @param {number=} high
  29. * @param {boolean=} unsigned
  30. * @constructor
  31. */
  32. var Long = function(low, high, unsigned) {};
  33. /**
  34. * @param {*} obj
  35. * @returns {boolean}
  36. */
  37. Long.isLong = function(obj) {};
  38. /**
  39. * @param {number} value
  40. * @param {boolean=} unsigned
  41. * @return {!Long}
  42. */
  43. Long.fromInt = function(value, unsigned) {};
  44. /**
  45. * @param {number} value
  46. * @param {boolean=} unsigned
  47. * @return {!Long}
  48. */
  49. Long.fromNumber = function(value, unsigned) {};
  50. /**
  51. * @param {number} lowBits
  52. * @param {number} highBits
  53. * @param {boolean=} unsigned
  54. * @return {!Long}
  55. */
  56. Long.fromBits = function(lowBits, highBits, unsigned) {};
  57. /**
  58. * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val
  59. * @returns {!Long}
  60. */
  61. Long.fromValue = function(val) {};
  62. /**
  63. * @param {string} str
  64. * @param {(boolean|number)=} unsigned
  65. * @param {number=} radix
  66. * @return {!Long}
  67. */
  68. Long.fromString = function(str, unsigned, radix) {};
  69. /**
  70. * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val
  71. * @return {!Long}
  72. */
  73. Long.valueOf = function(val) {};
  74. /**
  75. * @type {!Long}
  76. */
  77. Long.ZERO;
  78. /**
  79. * @type {!Long}
  80. */
  81. Long.UZERO;
  82. /**
  83. * @type {!Long}
  84. */
  85. Long.ONE;
  86. /**
  87. * @type {!Long}
  88. */
  89. Long.UONE;
  90. /**
  91. * @type {!Long}
  92. */
  93. Long.NEG_ONE;
  94. /**
  95. * @type {!Long}
  96. */
  97. Long.MAX_VALUE;
  98. /**
  99. * @type {!Long}
  100. */
  101. Long.MIN_VALUE;
  102. /**
  103. * @type {!Long}
  104. */
  105. Long.MAX_UNSIGNED_VALUE;
  106. /**
  107. * @type {number}
  108. */
  109. Long.prototype.low;
  110. /**
  111. * @type {number}
  112. */
  113. Long.prototype.high;
  114. /**
  115. * @type {boolean}
  116. */
  117. Long.prototype.unsigned;
  118. /**
  119. * @return {number}
  120. */
  121. Long.prototype.toInt = function() {};
  122. /**
  123. * @return {number}
  124. */
  125. Long.prototype.toNumber = function() {};
  126. /**
  127. * @param {number=} radix
  128. * @return {string}
  129. */
  130. Long.prototype.toString = function(radix) {};
  131. /**
  132. * @return {number}
  133. */
  134. Long.prototype.getHighBits = function() {};
  135. /**
  136. * @return {number}
  137. */
  138. Long.prototype.getHighBitsUnsigned = function() {};
  139. /**
  140. * @return {number}
  141. */
  142. Long.prototype.getLowBits = function() {};
  143. /**
  144. * @return {number}
  145. */
  146. Long.prototype.getLowBitsUnsigned = function() {};
  147. /**
  148. * @return {number}
  149. */
  150. Long.prototype.getNumBitsAbs = function() {};
  151. /**
  152. * @return {boolean}
  153. */
  154. Long.prototype.isZero = function() {};
  155. /**
  156. * @return {boolean}
  157. */
  158. Long.prototype.isNegative = function() {};
  159. /**
  160. * @return {boolean}
  161. */
  162. Long.prototype.isOdd = function() {};
  163. /**
  164. * @return {boolean}
  165. */
  166. Long.prototype.isEven = function() {};
  167. /**
  168. * @param {!Long|number|string} other
  169. * @return {boolean}
  170. */
  171. Long.prototype.equals = function(other) {};
  172. /**
  173. * @param {!Long|number|string} other
  174. * @return {boolean}
  175. */
  176. Long.prototype.eq = function(other) {};
  177. /**
  178. * @param {!Long|number|string} other
  179. * @return {boolean}
  180. */
  181. Long.prototype.notEquals = function(other) {};
  182. /**
  183. * @param {!Long|number|string} other
  184. * @return {boolean}
  185. */
  186. Long.prototype.neq = function(other) {};
  187. /**
  188. * @param {!Long|number|string} other
  189. * @return {boolean}
  190. */
  191. Long.prototype.lessThan = function(other) {};
  192. /**
  193. * @param {!Long|number|string} other
  194. * @return {boolean}
  195. */
  196. Long.prototype.lt = function(other) {};
  197. /**
  198. * @param {!Long|number|string} other
  199. * @return {boolean}
  200. */
  201. Long.prototype.lessThanOrEqual = function(other) {};
  202. /**
  203. * @param {!Long|number|string} other
  204. * @return {boolean}
  205. */
  206. Long.prototype.lte = function(other) {};
  207. /**
  208. * @param {!Long|number|string} other
  209. * @return {boolean}
  210. */
  211. Long.prototype.greaterThan = function(other) {};
  212. /**
  213. * @param {!Long|number|string} other
  214. * @return {boolean}
  215. */
  216. Long.prototype.gt = function(other) {};
  217. /**
  218. * @param {!Long|number|string} other
  219. * @return {boolean}
  220. */
  221. Long.prototype.greaterThanOrEqual = function(other) {};
  222. /**
  223. * @param {!Long|number|string} other
  224. * @return {boolean}
  225. */
  226. Long.prototype.gte = function(other) {};
  227. /**
  228. * @param {!Long|number|string} other
  229. * @return {number}
  230. */
  231. Long.prototype.compare = function(other) {};
  232. /**
  233. * @param {!Long|number|string} other
  234. * @return {number}
  235. */
  236. Long.prototype.comp = function(other) {};
  237. /**
  238. * @return {!Long}
  239. */
  240. Long.prototype.negate = function() {};
  241. /**
  242. * @return {!Long}
  243. */
  244. Long.prototype.neg = function() {};
  245. /**
  246. * @param {!Long|number|string} other
  247. * @return {!Long}
  248. */
  249. Long.prototype.add = function(other) {};
  250. /**
  251. * @param {!Long|number|string} other
  252. * @return {!Long}
  253. */
  254. Long.prototype.subtract = function(other) {};
  255. /**
  256. * @param {!Long|number|string} other
  257. * @return {!Long}
  258. */
  259. Long.prototype.sub = function(other) {};
  260. /**
  261. * @param {!Long|number|string} other
  262. * @return {!Long}
  263. */
  264. Long.prototype.multiply = function(other) {};
  265. /**
  266. * @param {!Long|number|string} other
  267. * @return {!Long}
  268. */
  269. Long.prototype.mul = function(other) {};
  270. /**
  271. * @param {!Long|number|string} other
  272. * @return {!Long}
  273. */
  274. Long.prototype.divide = function(other) {};
  275. /**
  276. * @param {!Long|number|string} other
  277. * @return {!Long}
  278. */
  279. Long.prototype.div = function(other) {};
  280. /**
  281. * @param {!Long|number|string} other
  282. * @return {!Long}
  283. */
  284. Long.prototype.modulo = function(other) {};
  285. /**
  286. * @param {!Long|number|string} other
  287. * @return {!Long}
  288. */
  289. Long.prototype.mod = function(other) {};
  290. /**
  291. * @return {!Long}
  292. */
  293. Long.prototype.not = function() {};
  294. /**
  295. * @param {!Long|number|string} other
  296. * @return {!Long}
  297. */
  298. Long.prototype.and = function(other) {};
  299. /**
  300. * @param {!Long|number|string} other
  301. * @return {!Long}
  302. */
  303. Long.prototype.or = function(other) {};
  304. /**
  305. * @param {!Long|number|string} other
  306. * @return {!Long}
  307. */
  308. Long.prototype.xor = function(other) {};
  309. /**
  310. * @param {number|!Long} numBits
  311. * @return {!Long}
  312. */
  313. Long.prototype.shiftLeft = function(numBits) {};
  314. /**
  315. * @param {number|!Long} numBits
  316. * @return {!Long}
  317. */
  318. Long.prototype.shl = function(numBits) {};
  319. /**
  320. * @param {number|!Long} numBits
  321. * @return {!Long}
  322. */
  323. Long.prototype.shiftRight = function(numBits) {};
  324. /**
  325. * @param {number|!Long} numBits
  326. * @return {!Long}
  327. */
  328. Long.prototype.shr = function(numBits) {};
  329. /**
  330. * @param {number|!Long} numBits
  331. * @return {!Long}
  332. */
  333. Long.prototype.shiftRightUnsigned = function(numBits) {};
  334. /**
  335. * @param {number|!Long} numBits
  336. * @return {!Long}
  337. */
  338. Long.prototype.shru = function(numBits) {};
  339. /**
  340. * @return {!Long}
  341. */
  342. Long.prototype.toSigned = function() {};
  343. /**
  344. * @return {!Long}
  345. */
  346. Long.prototype.toUnsigned = function() {};