@kitware/vtk.js 25.8.5 → 25.8.6

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.
Files changed (116) hide show
  1. package/Rendering/Core/Prop3D.js +6 -1
  2. package/Widgets/Representations/WidgetRepresentation.js +23 -7
  3. package/Widgets/SVG/SVGLandmarkRepresentation.js +13 -1
  4. package/_vendor/available-typed-arrays/index.js_commonjs-proxy.js +1 -0
  5. package/_vendor/call-bind/callBound.js_commonjs-proxy.js +1 -0
  6. package/_vendor/call-bind/index.js_commonjs-module.js +3 -0
  7. package/_vendor/call-bind/index.js_commonjs-proxy.js +1 -0
  8. package/_vendor/deep-equal/node_modules/isarray/index.js_commonjs-proxy.js +1 -0
  9. package/_vendor/define-properties/index.js_commonjs-proxy.js +1 -0
  10. package/_vendor/es-abstract/helpers/getOwnPropertyDescriptor.js_commonjs-proxy.js +1 -0
  11. package/_vendor/es-get-iterator/index.js_commonjs-module.js +3 -0
  12. package/_vendor/es-get-iterator/index.js_commonjs-proxy.js +1 -0
  13. package/_vendor/es-get-iterator/node_modules/isarray/index.js_commonjs-proxy.js +1 -0
  14. package/_vendor/foreach/index.js_commonjs-proxy.js +1 -0
  15. package/_vendor/function-bind/implementation.js_commonjs-proxy.js +1 -0
  16. package/_vendor/function-bind/index.js_commonjs-proxy.js +1 -0
  17. package/_vendor/get-intrinsic/index.js_commonjs-proxy.js +1 -0
  18. package/_vendor/has/src/index.js_commonjs-proxy.js +1 -0
  19. package/_vendor/has-bigints/index.js_commonjs-proxy.js +1 -0
  20. package/_vendor/has-symbols/index.js_commonjs-proxy.js +1 -0
  21. package/_vendor/has-symbols/shams.js_commonjs-proxy.js +1 -0
  22. package/_vendor/has-tostringtag/shams.js_commonjs-proxy.js +1 -0
  23. package/_vendor/is-arguments/index.js_commonjs-proxy.js +1 -0
  24. package/_vendor/is-bigint/index.js_commonjs-module.js +3 -0
  25. package/_vendor/is-bigint/index.js_commonjs-proxy.js +1 -0
  26. package/_vendor/is-boolean-object/index.js_commonjs-proxy.js +1 -0
  27. package/_vendor/is-date-object/index.js_commonjs-proxy.js +1 -0
  28. package/_vendor/is-map/index.js_commonjs-proxy.js +1 -0
  29. package/_vendor/is-number-object/index.js_commonjs-proxy.js +1 -0
  30. package/_vendor/is-regex/index.js_commonjs-proxy.js +1 -0
  31. package/_vendor/is-set/index.js_commonjs-proxy.js +1 -0
  32. package/_vendor/is-string/index.js_commonjs-proxy.js +1 -0
  33. package/_vendor/is-symbol/index.js_commonjs-module.js +3 -0
  34. package/_vendor/is-symbol/index.js_commonjs-proxy.js +1 -0
  35. package/_vendor/is-typed-array/index.js_commonjs-proxy.js +1 -0
  36. package/_vendor/is-weakmap/index.js_commonjs-proxy.js +1 -0
  37. package/_vendor/is-weakset/index.js_commonjs-proxy.js +1 -0
  38. package/_vendor/object-inspect/index.js_commonjs-proxy.js +1 -0
  39. package/_vendor/object-is/implementation.js_commonjs-proxy.js +1 -0
  40. package/_vendor/object-is/index.js_commonjs-proxy.js +1 -0
  41. package/_vendor/object-is/polyfill.js_commonjs-proxy.js +1 -0
  42. package/_vendor/object-is/shim.js_commonjs-proxy.js +1 -0
  43. package/_vendor/object-keys/implementation.js_commonjs-proxy.js +1 -0
  44. package/_vendor/object-keys/index.js_commonjs-proxy.js +1 -0
  45. package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +1 -0
  46. package/_vendor/object.assign/implementation.js_commonjs-proxy.js +1 -0
  47. package/_vendor/object.assign/index.js_commonjs-proxy.js +1 -0
  48. package/_vendor/object.assign/polyfill.js_commonjs-proxy.js +1 -0
  49. package/_vendor/object.assign/shim.js_commonjs-proxy.js +2 -0
  50. package/_vendor/regexp.prototype.flags/implementation.js_commonjs-proxy.js +1 -0
  51. package/_vendor/regexp.prototype.flags/index.js_commonjs-proxy.js +1 -0
  52. package/_vendor/regexp.prototype.flags/polyfill.js_commonjs-proxy.js +1 -0
  53. package/_vendor/regexp.prototype.flags/shim.js_commonjs-proxy.js +1 -0
  54. package/_vendor/side-channel/index.js_commonjs-proxy.js +1 -0
  55. package/_vendor/which-boxed-primitive/index.js_commonjs-proxy.js +5 -0
  56. package/_vendor/which-collection/index.js_commonjs-proxy.js +4 -0
  57. package/_vendor/which-typed-array/index.js_commonjs-proxy.js +1 -0
  58. package/_virtual/_node-resolve_empty.js_commonjs-proxy.js +6 -0
  59. package/_virtual/commonjsHelpers.js +18 -0
  60. package/_virtual/node-resolve_empty.js +8 -0
  61. package/_virtual/polyfill-node.global.js +5 -0
  62. package/_virtual/polyfill-node.process.js +225 -0
  63. package/macros.d.ts +5 -3
  64. package/macros.js +28 -3
  65. package/package.json +1 -1
  66. package/vendor/available-typed-arrays/index.js +29 -0
  67. package/vendor/call-bind/callBound.js +19 -0
  68. package/vendor/call-bind/index.js +52 -0
  69. package/vendor/deep-equal/index.js +379 -0
  70. package/vendor/deep-equal/node_modules/isarray/index.js +7 -0
  71. package/vendor/define-properties/index.js +60 -0
  72. package/vendor/es-abstract/helpers/getOwnPropertyDescriptor.js +17 -0
  73. package/vendor/es-get-iterator/index.js +217 -0
  74. package/vendor/es-get-iterator/node_modules/isarray/index.js +7 -0
  75. package/vendor/foreach/index.js +22 -0
  76. package/vendor/function-bind/implementation.js +52 -0
  77. package/vendor/function-bind/index.js +7 -0
  78. package/vendor/get-intrinsic/index.js +334 -0
  79. package/vendor/has/src/index.js +7 -0
  80. package/vendor/has-bigints/index.js +12 -0
  81. package/vendor/has-symbols/index.js +15 -0
  82. package/vendor/has-symbols/shams.js +42 -0
  83. package/vendor/has-tostringtag/shams.js +9 -0
  84. package/vendor/is-arguments/index.js +36 -0
  85. package/vendor/is-bigint/index.js +39 -0
  86. package/vendor/is-boolean-object/index.js +29 -0
  87. package/vendor/is-date-object/index.js +22 -0
  88. package/vendor/is-map/index.js +42 -0
  89. package/vendor/is-number-object/index.js +26 -0
  90. package/vendor/is-regex/index.js +61 -0
  91. package/vendor/is-set/index.js +42 -0
  92. package/vendor/is-string/index.js +26 -0
  93. package/vendor/is-symbol/index.js +36 -0
  94. package/vendor/is-typed-array/index.js +67 -0
  95. package/vendor/is-weakmap/index.js +42 -0
  96. package/vendor/is-weakset/index.js +42 -0
  97. package/vendor/object-inspect/index.js +515 -0
  98. package/vendor/object-is/implementation.js +18 -0
  99. package/vendor/object-is/index.js +25 -0
  100. package/vendor/object-is/polyfill.js +9 -0
  101. package/vendor/object-is/shim.js +17 -0
  102. package/vendor/object-keys/implementation.js +124 -0
  103. package/vendor/object-keys/index.js +35 -0
  104. package/vendor/object-keys/isArguments.js +17 -0
  105. package/vendor/object.assign/implementation.js +46 -0
  106. package/vendor/object.assign/index.js +29 -0
  107. package/vendor/object.assign/polyfill.js +57 -0
  108. package/vendor/object.assign/shim.js +17 -0
  109. package/vendor/regexp.prototype.flags/implementation.js +30 -0
  110. package/vendor/regexp.prototype.flags/index.js +25 -0
  111. package/vendor/regexp.prototype.flags/polyfill.js +23 -0
  112. package/vendor/regexp.prototype.flags/shim.js +29 -0
  113. package/vendor/side-channel/index.js +128 -0
  114. package/vendor/which-boxed-primitive/index.js +38 -0
  115. package/vendor/which-collection/index.js +29 -0
  116. package/vendor/which-typed-array/index.js +63 -0
@@ -1,7 +1,7 @@
1
1
  import { mat4, quat } from 'gl-matrix';
2
2
  import macro from '../../macros.js';
3
3
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
4
- import { B as degreesFromRadians, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
4
+ import { B as degreesFromRadians, r as radiansFromDegrees, a as areMatricesEqual } from '../../Common/Core/Math/index.js';
5
5
  import vtkProp from './Prop.js';
6
6
 
7
7
  // vtkProp3D methods
@@ -83,8 +83,13 @@ function vtkProp3D(publicAPI, model) {
83
83
  };
84
84
 
85
85
  publicAPI.setUserMatrix = function (matrix) {
86
+ if (areMatricesEqual(model.userMatrix, matrix)) {
87
+ return false;
88
+ }
89
+
86
90
  mat4.copy(model.userMatrix, matrix);
87
91
  publicAPI.modified();
92
+ return true;
88
93
  };
89
94
 
90
95
  publicAPI.getMatrix = function () {
@@ -1,4 +1,5 @@
1
1
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
3
  import macro from '../../macros.js';
3
4
  import vtkProp from '../../Rendering/Core/Prop.js';
4
5
  import { s as subtract, d as dot } from '../../Common/Core/Math/index.js';
@@ -6,6 +7,9 @@ import { Behavior } from './WidgetRepresentation/Constants.js';
6
7
  import { RenderingTypes } from '../Core/WidgetManager/Constants.js';
7
8
  import { CATEGORIES } from '../../Rendering/Core/Mapper/CoincidentTopologyHelper.js';
8
9
 
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
13
  var vtkErrorMacro = macro.vtkErrorMacro,
10
14
  vtkWarningMacro = macro.vtkWarningMacro; // ----------------------------------------------------------------------------
11
15
 
@@ -80,7 +84,10 @@ function connectPipeline(pipeline) {
80
84
 
81
85
  function vtkWidgetRepresentation(publicAPI, model) {
82
86
  // Set our className
83
- model.classHierarchy.push('vtkWidgetRepresentation'); // Internal cache
87
+ model.classHierarchy.push('vtkWidgetRepresentation');
88
+
89
+ var superclass = _objectSpread({}, publicAPI); // Internal cache
90
+
84
91
 
85
92
  var cache = {
86
93
  mtimes: {},
@@ -210,10 +217,13 @@ function vtkWidgetRepresentation(publicAPI, model) {
210
217
  };
211
218
 
212
219
  publicAPI.setCoincidentTopologyParameters = function (parameters) {
213
- model.coincidentTopologyParameters = parameters;
214
- publicAPI.getActors().forEach(function (actor) {
215
- applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);
216
- });
220
+ var modified = superclass.setCoincidentTopologyParameters(parameters);
221
+
222
+ if (modified) {
223
+ publicAPI.getActors().forEach(function (actor) {
224
+ applyCoincidentTopologyParametersToMapper(actor.getMapper(), model.coincidentTopologyParameters);
225
+ });
226
+ }
217
227
  };
218
228
 
219
229
  publicAPI.getPixelWorldHeightAtCoord = function (worldCoord) {
@@ -279,8 +289,14 @@ function extend(publicAPI, model) {
279
289
 
280
290
  vtkProp.extend(publicAPI, model, initialValues);
281
291
  macro.algo(publicAPI, model, 1, 1);
282
- macro.get(publicAPI, model, ['labels', 'coincidentTopologyParameters']);
283
- macro.set(publicAPI, model, ['displayScaleParams']);
292
+ macro.get(publicAPI, model, ['labels']);
293
+ macro.set(publicAPI, model, [{
294
+ type: 'object',
295
+ name: 'displayScaleParams'
296
+ }, {
297
+ type: 'object',
298
+ name: 'coincidentTopologyParameters'
299
+ }]);
284
300
  macro.setGet(publicAPI, model, ['scaleInPixels']); // Object specific methods
285
301
 
286
302
  vtkWidgetRepresentation(publicAPI, model);
@@ -152,7 +152,19 @@ function defaultValues(initialValues) {
152
152
  function extend(publicAPI, model) {
153
153
  var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
154
154
  vtkSVGRepresentation.extend(publicAPI, model, defaultValues(initialValues));
155
- macro.setGet(publicAPI, model, ['circleProps', 'fontProperties', 'strokeFontProperties', 'textProps']); // Object specific methods
155
+ macro.setGet(publicAPI, model, [{
156
+ type: 'object',
157
+ name: 'circleProps'
158
+ }, {
159
+ type: 'object',
160
+ name: 'fontProperties'
161
+ }, {
162
+ type: 'object',
163
+ name: 'strokeFontProperties'
164
+ }, {
165
+ type: 'object',
166
+ name: 'textProps'
167
+ }]); // Object specific methods
156
168
 
157
169
  vtkSVGLandmarkRepresentation(publicAPI, model);
158
170
  } // ----------------------------------------------------------------------------
@@ -0,0 +1 @@
1
+ import '../../vendor/call-bind/callBound.js';
@@ -0,0 +1,3 @@
1
+ var callBind = {exports: {}};
2
+
3
+ export { callBind as c };
@@ -0,0 +1 @@
1
+ import '../../vendor/call-bind/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/define-properties/index.js';
@@ -0,0 +1,3 @@
1
+ var esGetIterator = {exports: {}};
2
+
3
+ export { esGetIterator as e };
@@ -0,0 +1 @@
1
+ import '../../vendor/es-get-iterator/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/get-intrinsic/index.js';
@@ -0,0 +1 @@
1
+ import '../../../vendor/has/src/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/has-bigints/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-arguments/index.js';
@@ -0,0 +1,3 @@
1
+ var isBigint = {exports: {}};
2
+
3
+ export { isBigint as i };
@@ -0,0 +1 @@
1
+ import '../../vendor/is-bigint/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-boolean-object/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-map/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-number-object/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-regex/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-set/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-string/index.js';
@@ -0,0 +1,3 @@
1
+ var isSymbol = {exports: {}};
2
+
3
+ export { isSymbol as i };
@@ -0,0 +1 @@
1
+ import '../../vendor/is-symbol/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-typed-array/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-weakmap/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/is-weakset/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object-is/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/define-properties/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object-keys/implementation.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object-keys/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object.assign/implementation.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object.assign/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/object.assign/implementation.js';
@@ -0,0 +1,2 @@
1
+ import '../../vendor/define-properties/index.js';
2
+ import '../../vendor/object.assign/implementation.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/regexp.prototype.flags/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/define-properties/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/define-properties/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/side-channel/index.js';
@@ -0,0 +1,5 @@
1
+ import '../../vendor/is-string/index.js';
2
+ import '../../vendor/is-number-object/index.js';
3
+ import '../../vendor/is-boolean-object/index.js';
4
+ import '../../vendor/is-symbol/index.js';
5
+ import '../../vendor/is-bigint/index.js';
@@ -0,0 +1,4 @@
1
+ import '../../vendor/is-map/index.js';
2
+ import '../../vendor/is-set/index.js';
3
+ import '../../vendor/is-weakmap/index.js';
4
+ import '../../vendor/is-weakset/index.js';
@@ -0,0 +1 @@
1
+ import '../../vendor/which-typed-array/index.js';
@@ -0,0 +1,6 @@
1
+ import { _ as _nodeResolve_empty } from './node-resolve_empty.js';
2
+ import { g as getAugmentedNamespace } from './commonjsHelpers.js';
3
+
4
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty);
5
+
6
+ export { require$$0 as r };
@@ -0,0 +1,18 @@
1
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+
3
+ function getAugmentedNamespace(n) {
4
+ if (n.__esModule) return n;
5
+ var a = Object.defineProperty({}, '__esModule', {value: true});
6
+ Object.keys(n).forEach(function (k) {
7
+ var d = Object.getOwnPropertyDescriptor(n, k);
8
+ Object.defineProperty(a, k, d.get ? d : {
9
+ enumerable: true,
10
+ get: function () {
11
+ return n[k];
12
+ }
13
+ });
14
+ });
15
+ return a;
16
+ }
17
+
18
+ export { commonjsGlobal as c, getAugmentedNamespace as g };
@@ -0,0 +1,8 @@
1
+ var _nodeResolve_empty = {};
2
+
3
+ var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
4
+ __proto__: null,
5
+ 'default': _nodeResolve_empty
6
+ });
7
+
8
+ export { _nodeResolve_empty$1 as _ };
@@ -0,0 +1,5 @@
1
+ var global$1 = (typeof global !== "undefined" ? global :
2
+ typeof self !== "undefined" ? self :
3
+ typeof window !== "undefined" ? window : {});
4
+
5
+ export { global$1 as g };
@@ -0,0 +1,225 @@
1
+ import { g as global } from './polyfill-node.global.js';
2
+
3
+ // shim for using process in browser
4
+ // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
5
+
6
+ function defaultSetTimout() {
7
+ throw new Error('setTimeout has not been defined');
8
+ }
9
+ function defaultClearTimeout () {
10
+ throw new Error('clearTimeout has not been defined');
11
+ }
12
+ var cachedSetTimeout = defaultSetTimout;
13
+ var cachedClearTimeout = defaultClearTimeout;
14
+ if (typeof global.setTimeout === 'function') {
15
+ cachedSetTimeout = setTimeout;
16
+ }
17
+ if (typeof global.clearTimeout === 'function') {
18
+ cachedClearTimeout = clearTimeout;
19
+ }
20
+
21
+ function runTimeout(fun) {
22
+ if (cachedSetTimeout === setTimeout) {
23
+ //normal enviroments in sane situations
24
+ return setTimeout(fun, 0);
25
+ }
26
+ // if setTimeout wasn't available but was latter defined
27
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
28
+ cachedSetTimeout = setTimeout;
29
+ return setTimeout(fun, 0);
30
+ }
31
+ try {
32
+ // when when somebody has screwed with setTimeout but no I.E. maddness
33
+ return cachedSetTimeout(fun, 0);
34
+ } catch(e){
35
+ try {
36
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
37
+ return cachedSetTimeout.call(null, fun, 0);
38
+ } catch(e){
39
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
40
+ return cachedSetTimeout.call(this, fun, 0);
41
+ }
42
+ }
43
+
44
+
45
+ }
46
+ function runClearTimeout(marker) {
47
+ if (cachedClearTimeout === clearTimeout) {
48
+ //normal enviroments in sane situations
49
+ return clearTimeout(marker);
50
+ }
51
+ // if clearTimeout wasn't available but was latter defined
52
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
53
+ cachedClearTimeout = clearTimeout;
54
+ return clearTimeout(marker);
55
+ }
56
+ try {
57
+ // when when somebody has screwed with setTimeout but no I.E. maddness
58
+ return cachedClearTimeout(marker);
59
+ } catch (e){
60
+ try {
61
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
62
+ return cachedClearTimeout.call(null, marker);
63
+ } catch (e){
64
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
65
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
66
+ return cachedClearTimeout.call(this, marker);
67
+ }
68
+ }
69
+
70
+
71
+
72
+ }
73
+ var queue = [];
74
+ var draining = false;
75
+ var currentQueue;
76
+ var queueIndex = -1;
77
+
78
+ function cleanUpNextTick() {
79
+ if (!draining || !currentQueue) {
80
+ return;
81
+ }
82
+ draining = false;
83
+ if (currentQueue.length) {
84
+ queue = currentQueue.concat(queue);
85
+ } else {
86
+ queueIndex = -1;
87
+ }
88
+ if (queue.length) {
89
+ drainQueue();
90
+ }
91
+ }
92
+
93
+ function drainQueue() {
94
+ if (draining) {
95
+ return;
96
+ }
97
+ var timeout = runTimeout(cleanUpNextTick);
98
+ draining = true;
99
+
100
+ var len = queue.length;
101
+ while(len) {
102
+ currentQueue = queue;
103
+ queue = [];
104
+ while (++queueIndex < len) {
105
+ if (currentQueue) {
106
+ currentQueue[queueIndex].run();
107
+ }
108
+ }
109
+ queueIndex = -1;
110
+ len = queue.length;
111
+ }
112
+ currentQueue = null;
113
+ draining = false;
114
+ runClearTimeout(timeout);
115
+ }
116
+ function nextTick(fun) {
117
+ var args = new Array(arguments.length - 1);
118
+ if (arguments.length > 1) {
119
+ for (var i = 1; i < arguments.length; i++) {
120
+ args[i - 1] = arguments[i];
121
+ }
122
+ }
123
+ queue.push(new Item(fun, args));
124
+ if (queue.length === 1 && !draining) {
125
+ runTimeout(drainQueue);
126
+ }
127
+ }
128
+ // v8 likes predictible objects
129
+ function Item(fun, array) {
130
+ this.fun = fun;
131
+ this.array = array;
132
+ }
133
+ Item.prototype.run = function () {
134
+ this.fun.apply(null, this.array);
135
+ };
136
+ var title = 'browser';
137
+ var platform = 'browser';
138
+ var browser = true;
139
+ var env = {};
140
+ var argv = [];
141
+ var version = ''; // empty string to avoid regexp issues
142
+ var versions = {};
143
+ var release = {};
144
+ var config = {};
145
+
146
+ function noop() {}
147
+
148
+ var on = noop;
149
+ var addListener = noop;
150
+ var once = noop;
151
+ var off = noop;
152
+ var removeListener = noop;
153
+ var removeAllListeners = noop;
154
+ var emit = noop;
155
+
156
+ function binding(name) {
157
+ throw new Error('process.binding is not supported');
158
+ }
159
+
160
+ function cwd () { return '/' }
161
+ function chdir (dir) {
162
+ throw new Error('process.chdir is not supported');
163
+ }function umask() { return 0; }
164
+
165
+ // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
166
+ var performance = global.performance || {};
167
+ var performanceNow =
168
+ performance.now ||
169
+ performance.mozNow ||
170
+ performance.msNow ||
171
+ performance.oNow ||
172
+ performance.webkitNow ||
173
+ function(){ return (new Date()).getTime() };
174
+
175
+ // generate timestamp or delta
176
+ // see http://nodejs.org/api/process.html#process_process_hrtime
177
+ function hrtime(previousTimestamp){
178
+ var clocktime = performanceNow.call(performance)*1e-3;
179
+ var seconds = Math.floor(clocktime);
180
+ var nanoseconds = Math.floor((clocktime%1)*1e9);
181
+ if (previousTimestamp) {
182
+ seconds = seconds - previousTimestamp[0];
183
+ nanoseconds = nanoseconds - previousTimestamp[1];
184
+ if (nanoseconds<0) {
185
+ seconds--;
186
+ nanoseconds += 1e9;
187
+ }
188
+ }
189
+ return [seconds,nanoseconds]
190
+ }
191
+
192
+ var startTime = new Date();
193
+ function uptime() {
194
+ var currentTime = new Date();
195
+ var dif = currentTime - startTime;
196
+ return dif / 1000;
197
+ }
198
+
199
+ var browser$1 = {
200
+ nextTick: nextTick,
201
+ title: title,
202
+ browser: browser,
203
+ env: env,
204
+ argv: argv,
205
+ version: version,
206
+ versions: versions,
207
+ on: on,
208
+ addListener: addListener,
209
+ once: once,
210
+ off: off,
211
+ removeListener: removeListener,
212
+ removeAllListeners: removeAllListeners,
213
+ emit: emit,
214
+ binding: binding,
215
+ cwd: cwd,
216
+ chdir: chdir,
217
+ umask: umask,
218
+ hrtime: hrtime,
219
+ platform: platform,
220
+ release: release,
221
+ config: config,
222
+ uptime: uptime
223
+ };
224
+
225
+ export { browser$1 as b };
package/macros.d.ts CHANGED
@@ -172,17 +172,19 @@ export function get(publicAPI: object, model: object, fieldNames: Array<string>)
172
172
  * @param publicAPI object on which public methods get attached to
173
173
  * @param model object on which protected fields are stored
174
174
  * @param fieldNames list of fields available in model that we want to expose as set{FieldName} methods on the publicAPI
175
+ * * Can be a string (the name of the field to expose) or an object (e.g. {type:enum, name: {FieldName}, enum: FieldEnum}).
175
176
  */
176
- export function set(publicAPI: object, model: object, fields: Array<string>): void;
177
+ export function set(publicAPI: object, model: object, fields: Array<string|object>): void;
177
178
 
178
179
  /**
179
180
  * Add setter+getter methods to the provided publicAPI
180
181
  *
181
182
  * @param publicAPI object on which public methods get attached to
182
183
  * @param model object on which protected fields are stored
183
- * @param fieldNames list of fields available in model that we want to expose as set{FieldName}+get{FieldName} methods on the publicAPI
184
+ * @param fieldNames list of fields available in model that we want to expose as set{FieldName}+get{FieldName} methods on the publicAPI.
185
+ * Can be a string (the name of the field to expose) or an object (e.g. {type:enum, name: {FieldName}, enum: FieldEnum}).
184
186
  */
185
- export function setGet(publicAPI: object, model: object, fields: Array<string>): void;
187
+ export function setGet(publicAPI: object, model: object, fields: Array<string|object>): void;
186
188
 
187
189
  /**
188
190
  * Add getter methods to the provided publicAPI for arrays.