types.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.PARENT_MESSAGE_SETUP_ERROR =
  6. exports.PARENT_MESSAGE_OK =
  7. exports.PARENT_MESSAGE_CUSTOM =
  8. exports.PARENT_MESSAGE_CLIENT_ERROR =
  9. exports.CHILD_MESSAGE_INITIALIZE =
  10. exports.CHILD_MESSAGE_END =
  11. exports.CHILD_MESSAGE_CALL =
  12. void 0;
  13. /**
  14. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  15. *
  16. * This source code is licensed under the MIT license found in the
  17. * LICENSE file in the root directory of this source tree.
  18. */
  19. // import type {ResourceLimits} from 'worker_threads';
  20. // This is not present in the Node 12 typings
  21. // Because of the dynamic nature of a worker communication process, all messages
  22. // coming from any of the other processes cannot be typed. Thus, many types
  23. // include "unknown" as a TS type, which is (unfortunately) correct here.
  24. const CHILD_MESSAGE_INITIALIZE = 0;
  25. exports.CHILD_MESSAGE_INITIALIZE = CHILD_MESSAGE_INITIALIZE;
  26. const CHILD_MESSAGE_CALL = 1;
  27. exports.CHILD_MESSAGE_CALL = CHILD_MESSAGE_CALL;
  28. const CHILD_MESSAGE_END = 2;
  29. exports.CHILD_MESSAGE_END = CHILD_MESSAGE_END;
  30. const PARENT_MESSAGE_OK = 0;
  31. exports.PARENT_MESSAGE_OK = PARENT_MESSAGE_OK;
  32. const PARENT_MESSAGE_CLIENT_ERROR = 1;
  33. exports.PARENT_MESSAGE_CLIENT_ERROR = PARENT_MESSAGE_CLIENT_ERROR;
  34. const PARENT_MESSAGE_SETUP_ERROR = 2;
  35. exports.PARENT_MESSAGE_SETUP_ERROR = PARENT_MESSAGE_SETUP_ERROR;
  36. const PARENT_MESSAGE_CUSTOM = 3;
  37. exports.PARENT_MESSAGE_CUSTOM = PARENT_MESSAGE_CUSTOM;