minimal-env.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * @fileoverview Minimal environment for bcrypt.js.
  3. * @externs
  4. */
  5. /**
  6. * @param {string} moduleName
  7. * returns {*}
  8. */
  9. function require(moduleName) {}
  10. /**
  11. * @constructor
  12. * @private
  13. */
  14. var Module = function() {};
  15. /**
  16. * @type {*}
  17. */
  18. Module.prototype.exports;
  19. /**
  20. * @type {Module}
  21. */
  22. var module;
  23. /**
  24. * @type {string}
  25. */
  26. var __dirname;
  27. /**
  28. * @type {Object.<string,*>}
  29. */
  30. var process = {};
  31. /**
  32. * @param {function()} func
  33. */
  34. process.nextTick = function(func) {};
  35. /**
  36. * @param {string} s
  37. * @constructor
  38. * @extends Array
  39. */
  40. var Buffer = function(s) {};
  41. /**
  42. BEGIN_NODE_INCLUDE
  43. var crypto = require('crypto');
  44. END_NODE_INCLUDE
  45. */
  46. /**
  47. * @type {Object.<string,*>}
  48. */
  49. var crypto = {};
  50. /**
  51. * @param {number} n
  52. * @returns {Array.<number>}
  53. */
  54. crypto.randomBytes = function(n) {};
  55. /**
  56. * @type {Object.<string,*>}
  57. */
  58. window.crypto = {};
  59. /**
  60. * @param {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array} array
  61. */
  62. window.crypto.getRandomValues = function(array) {};
  63. /**
  64. * @param {string} name
  65. * @param {function(...[*]):*} constructor
  66. */
  67. var define = function(name, constructor) {};
  68. /**
  69. * @type {boolean}
  70. */
  71. define.amd;
  72. /**
  73. * @param {...*} var_args
  74. * @returns {string}
  75. */
  76. String.fromCodePoint = function(var_args) {};
  77. /**
  78. * @param {number} offset
  79. * @returns {number}
  80. */
  81. String.prototype.codePointAt = function(offset) {};