index.d.mts 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. import { __export } from "./chunk-BQ42LXoh.mjs";
  2. import { WriteStream } from "tty";
  3. import { Config, Global } from "@jest/types";
  4. //#region src/preRunMessage.d.ts
  5. declare namespace preRunMessage_d_exports {
  6. export { print, remove };
  7. }
  8. declare function print(stream: WriteStream): void;
  9. declare function remove(stream: WriteStream): void;
  10. declare namespace specialChars_d_exports {
  11. export { ARROW, CLEAR, ICONS };
  12. }
  13. /**
  14. * Copyright (c) Meta Platforms, Inc. and affiliates.
  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. declare const ARROW = " \u203A ";
  20. declare const ICONS: {
  21. failed: string;
  22. pending: string;
  23. success: string;
  24. todo: string;
  25. };
  26. declare const CLEAR: string;
  27. //#endregion
  28. //#region src/clearLine.d.ts
  29. declare function clearLine(stream: WriteStream): void;
  30. //#endregion
  31. //#region src/createDirectory.d.ts
  32. /**
  33. * Copyright (c) Meta Platforms, Inc. and affiliates.
  34. *
  35. * This source code is licensed under the MIT license found in the
  36. * LICENSE file in the root directory of this source tree.
  37. */
  38. declare function createDirectory(path: string): void;
  39. //#endregion
  40. //#region src/ErrorWithStack.d.ts
  41. /**
  42. * Copyright (c) Meta Platforms, Inc. and affiliates.
  43. *
  44. * This source code is licensed under the MIT license found in the
  45. * LICENSE file in the root directory of this source tree.
  46. */
  47. declare class ErrorWithStack extends Error {
  48. constructor(message: string | undefined, callsite: (...args: Array<any>) => unknown, stackLimit?: number);
  49. }
  50. //#endregion
  51. //#region src/garbage-collection-utils.d.ts
  52. /**
  53. * - <b>off</b>: deletion is completely turned off.
  54. * - <b>soft</b>: doesn't delete objects, but instead wraps their getter/setter with a deprecation warning.
  55. * - <b>on</b>: actually delete objects (using `delete`).
  56. */
  57. type DeletionMode = 'soft' | 'off' | 'on';
  58. /**
  59. * Initializes the garbage collection utils with the given deletion mode.
  60. *
  61. * @param globalObject the global object on which to store the deletion mode.
  62. * @param deletionMode the deletion mode to use.
  63. */
  64. declare function initializeGarbageCollectionUtils(globalObject: typeof globalThis, deletionMode: DeletionMode): void;
  65. /**
  66. * Deletes all the properties from the given value (if it's an object),
  67. * unless the value was protected via {@link #protectProperties}.
  68. *
  69. * @param value the given value.
  70. */
  71. declare function deleteProperties(value: unknown): void;
  72. /**
  73. * Protects the given value from being deleted by {@link #deleteProperties}.
  74. *
  75. * @param value The given value.
  76. * @param properties If the array contains any property,
  77. * then only these properties will be protected; otherwise if the array is empty,
  78. * all properties will be protected.
  79. * @param depth Determines how "deep" the protection should be.
  80. * A value of 0 means that only the top-most properties will be protected,
  81. * while a value larger than 0 means that deeper levels of nesting will be protected as well.
  82. */
  83. declare function protectProperties<T>(value: T, properties?: Array<keyof T>, depth?: number): boolean;
  84. /**
  85. * Whether the given value has properties that can be deleted (regardless of protection).
  86. *
  87. * @param value The given value.
  88. */
  89. declare function canDeleteProperties(value: unknown): value is object;
  90. //#endregion
  91. //#region src/installCommonGlobals.d.ts
  92. declare function installCommonGlobals(globalObject: typeof globalThis, globals: Config.ConfigGlobals, garbageCollectionDeletionMode?: DeletionMode): typeof globalThis & Config.ConfigGlobals;
  93. //#endregion
  94. //#region src/interopRequireDefault.d.ts
  95. /**
  96. * Copyright (c) Meta Platforms, Inc. and affiliates.
  97. *
  98. * This source code is licensed under the MIT license found in the
  99. * LICENSE file in the root directory of this source tree.
  100. */
  101. declare function interopRequireDefault(obj: any): any;
  102. //#endregion
  103. //#region src/isInteractive.d.ts
  104. /**
  105. * Copyright (c) Meta Platforms, Inc. and affiliates.
  106. *
  107. * This source code is licensed under the MIT license found in the
  108. * LICENSE file in the root directory of this source tree.
  109. */
  110. declare const isInteractive: boolean;
  111. //#endregion
  112. //#region src/isPromise.d.ts
  113. /**
  114. * Copyright (c) Meta Platforms, Inc. and affiliates.
  115. *
  116. * This source code is licensed under the MIT license found in the
  117. * LICENSE file in the root directory of this source tree.
  118. */
  119. declare function isPromise<T = unknown>(candidate: unknown): candidate is PromiseLike<T>;
  120. //#endregion
  121. //#region src/setGlobal.d.ts
  122. declare function setGlobal(globalToMutate: typeof globalThis | Global.Global, key: string | symbol, value: unknown, afterTeardown?: 'clean' | 'retain'): void;
  123. //#endregion
  124. //#region src/deepCyclicCopy.d.ts
  125. /**
  126. * Copyright (c) Meta Platforms, Inc. and affiliates.
  127. *
  128. * This source code is licensed under the MIT license found in the
  129. * LICENSE file in the root directory of this source tree.
  130. */
  131. type DeepCyclicCopyOptions = {
  132. blacklist?: Set<string>;
  133. keepPrototype?: boolean;
  134. };
  135. declare function deepCyclicCopy<T>(value: T, options?: DeepCyclicCopyOptions, cycles?: WeakMap<any, any>): T;
  136. //#endregion
  137. //#region src/convertDescriptorToString.d.ts
  138. declare function convertDescriptorToString(descriptor: Global.BlockNameLike | undefined): string;
  139. //#endregion
  140. //#region src/replacePathSepForGlob.d.ts
  141. /**
  142. * Copyright (c) Meta Platforms, Inc. and affiliates.
  143. *
  144. * This source code is licensed under the MIT license found in the
  145. * LICENSE file in the root directory of this source tree.
  146. */
  147. declare function replacePathSepForGlob(path: string): string;
  148. //#endregion
  149. //#region src/globsToMatcher.d.ts
  150. /**
  151. * Copyright (c) Meta Platforms, Inc. and affiliates.
  152. *
  153. * This source code is licensed under the MIT license found in the
  154. * LICENSE file in the root directory of this source tree.
  155. */
  156. type Matcher = (str: string) => boolean;
  157. /**
  158. * Converts a list of globs into a function that matches a path against the
  159. * globs.
  160. *
  161. * Every time picomatch is called, it will parse the glob strings and turn
  162. * them into regexp instances. Instead of calling picomatch repeatedly with
  163. * the same globs, we can use this function which will build the picomatch
  164. * matchers ahead of time and then have an optimized path for determining
  165. * whether an individual path matches.
  166. *
  167. * This function is intended to match the behavior of `micromatch()`.
  168. *
  169. * @example
  170. * const isMatch = globsToMatcher(['*.js', '!*.test.js']);
  171. * isMatch('pizza.js'); // true
  172. * isMatch('pizza.test.js'); // false
  173. */
  174. declare function globsToMatcher(globs: Array<string>): Matcher;
  175. //#endregion
  176. //#region src/pluralize.d.ts
  177. /**
  178. * Copyright (c) Meta Platforms, Inc. and affiliates.
  179. *
  180. * This source code is licensed under the MIT license found in the
  181. * LICENSE file in the root directory of this source tree.
  182. */
  183. declare function pluralize(word: string, count: number, ending?: string): string;
  184. //#endregion
  185. //#region src/formatTime.d.ts
  186. /**
  187. * Copyright (c) Meta Platforms, Inc. and affiliates.
  188. *
  189. * This source code is licensed under the MIT license found in the
  190. * LICENSE file in the root directory of this source tree.
  191. */
  192. declare function formatTime(time: number, prefixPower?: number, padLeftLength?: number): string;
  193. //#endregion
  194. //#region src/tryRealpath.d.ts
  195. /**
  196. * Copyright (c) Meta Platforms, Inc. and affiliates.
  197. *
  198. * This source code is licensed under the MIT license found in the
  199. * LICENSE file in the root directory of this source tree.
  200. */
  201. declare function tryRealpath(path: string): string;
  202. //#endregion
  203. //#region src/requireOrImportModule.d.ts
  204. /**
  205. * Copyright (c) Meta Platforms, Inc. and affiliates.
  206. *
  207. * This source code is licensed under the MIT license found in the
  208. * LICENSE file in the root directory of this source tree.
  209. */
  210. declare function requireOrImportModule<T>(filePath: string, applyInteropRequireDefault?: boolean): Promise<T>;
  211. //#endregion
  212. //#region src/invariant.d.ts
  213. /**
  214. * Copyright (c) Meta Platforms, Inc. and affiliates.
  215. *
  216. * This source code is licensed under the MIT license found in the
  217. * LICENSE file in the root directory of this source tree.
  218. */
  219. declare function invariant(condition: unknown, message?: string): asserts condition;
  220. //#endregion
  221. //#region src/isNonNullable.d.ts
  222. /**
  223. * Copyright (c) Meta Platforms, Inc. and affiliates.
  224. *
  225. * This source code is licensed under the MIT license found in the
  226. * LICENSE file in the root directory of this source tree.
  227. */
  228. declare function isNonNullable<T>(value: T): value is NonNullable<T>;
  229. //#endregion
  230. export { DeletionMode, ErrorWithStack, canDeleteProperties, clearLine, convertDescriptorToString, createDirectory, deepCyclicCopy, deleteProperties, formatTime, globsToMatcher, initializeGarbageCollectionUtils, installCommonGlobals, interopRequireDefault, invariant, isInteractive, isNonNullable, isPromise, pluralize, preRunMessage_d_exports as preRunMessage, protectProperties, replacePathSepForGlob, requireOrImportModule, setGlobal, specialChars_d_exports as specialChars, tryRealpath };