@discourse/types 0.0.2 → 2026.1.0-2709d36

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 (461) hide show
  1. package/declarations/admin/components/admin-config-areas/upcoming-change-item.d.ts +1 -1
  2. package/declarations/admin/components/admin-config-areas/upcoming-changes.d.ts +5 -0
  3. package/declarations/admin/components/admin-config-areas/upcoming-changes.d.ts.map +1 -1
  4. package/declarations/admin/components/admin-theme-editor.d.ts +1 -1
  5. package/declarations/admin/components/admin-welcome-banner-form.d.ts.map +1 -1
  6. package/declarations/admin/components/color-input.d.ts.map +1 -1
  7. package/declarations/admin/components/color-palette-editor.d.ts.map +1 -1
  8. package/declarations/admin/components/dashboard-new-features.d.ts.map +1 -1
  9. package/declarations/admin/components/edit-category-general.d.ts +3 -1
  10. package/declarations/admin/components/edit-category-general.d.ts.map +1 -1
  11. package/declarations/admin/components/edit-category-security.d.ts.map +1 -1
  12. package/declarations/admin/components/edit-category-settings.d.ts.map +1 -1
  13. package/declarations/admin/components/form-template/form.d.ts.map +1 -1
  14. package/declarations/admin/components/site-settings/upload.d.ts +45 -4
  15. package/declarations/admin/components/site-settings/upload.d.ts.map +1 -1
  16. package/declarations/admin/components/webhook-event.d.ts +2 -2
  17. package/declarations/admin/lib/hex-to-rgba.d.ts.map +1 -1
  18. package/declarations/admin/lib/template-form-fields.d.ts.map +1 -1
  19. package/declarations/admin/models/color-scheme-color.d.ts.map +1 -1
  20. package/declarations/admin/models/email-template.d.ts +1 -1
  21. package/declarations/admin/models/report.d.ts +12 -12
  22. package/declarations/admin/routes/admin-config/upcoming-changes.d.ts +1 -0
  23. package/declarations/admin/routes/admin-config/upcoming-changes.d.ts.map +1 -1
  24. package/declarations/app/components/bookmark-icon.d.ts +1 -1
  25. package/declarations/app/components/bookmark-menu.d.ts +1 -1
  26. package/declarations/app/components/category-permission-row.d.ts.map +1 -1
  27. package/declarations/app/components/composer-toggles.d.ts +1 -1
  28. package/declarations/app/components/d-button.d.ts +144 -4
  29. package/declarations/app/components/d-button.d.ts.map +1 -1
  30. package/declarations/app/components/d-editor.d.ts +0 -1
  31. package/declarations/app/components/d-editor.d.ts.map +1 -1
  32. package/declarations/app/components/d-navigation-item.d.ts +1 -1
  33. package/declarations/app/components/date-input.d.ts +1 -1
  34. package/declarations/app/components/date-picker.d.ts +1 -1
  35. package/declarations/app/components/form-template-field/composer.d.ts +7 -0
  36. package/declarations/app/components/form-template-field/composer.d.ts.map +1 -0
  37. package/declarations/app/components/form-template-field/wrapper.d.ts +1 -0
  38. package/declarations/app/components/form-template-field/wrapper.d.ts.map +1 -1
  39. package/declarations/app/components/group-manage-save-button.d.ts +2 -4
  40. package/declarations/app/components/group-manage-save-button.d.ts.map +1 -1
  41. package/declarations/app/components/group-smtp-email-settings.d.ts +1 -1
  42. package/declarations/app/components/header/contents.d.ts +1 -1
  43. package/declarations/app/components/header/logo.d.ts +1 -1
  44. package/declarations/app/components/header/search-menu-wrapper.d.ts +1 -1
  45. package/declarations/app/components/header/topic/info.d.ts +1 -1
  46. package/declarations/app/components/interface-color-selector.d.ts +1 -1
  47. package/declarations/app/components/light-dark-img.d.ts +1 -1
  48. package/declarations/app/components/modal/avatar-selector.d.ts +1 -1
  49. package/declarations/app/components/modal/create-invite.d.ts +2 -0
  50. package/declarations/app/components/modal/create-invite.d.ts.map +1 -1
  51. package/declarations/app/components/modal/group-default-notifications.d.ts.map +1 -1
  52. package/declarations/app/components/modal/move-to-topic.d.ts +1 -1
  53. package/declarations/app/components/modal/spreadsheet-editor.d.ts.map +1 -1
  54. package/declarations/app/components/post/menu/buttons/delete.d.ts +2 -2
  55. package/declarations/app/components/post/meta-data/reply-to-tab.d.ts.map +1 -1
  56. package/declarations/app/components/post/quoted-content.d.ts +1 -1
  57. package/declarations/app/components/post-language-selector.d.ts.map +1 -1
  58. package/declarations/app/components/post-list/item/index.d.ts +1 -1
  59. package/declarations/app/components/reviewable-bundled-action.d.ts +1 -1
  60. package/declarations/app/components/reviewable-refresh/item.d.ts.map +1 -1
  61. package/declarations/app/components/reviewable-refresh/timeline.d.ts.map +1 -1
  62. package/declarations/app/components/sidebar/common/custom-section.d.ts +3 -3
  63. package/declarations/app/components/sidebar/common/custom-section.d.ts.map +1 -1
  64. package/declarations/app/components/sidebar/edit-navigation-menu/categories-modal.d.ts.map +1 -1
  65. package/declarations/app/components/sidebar/user/tags-section.d.ts +2 -2
  66. package/declarations/app/components/sidebar/user/tags-section.d.ts.map +1 -1
  67. package/declarations/app/components/signup-progress-bar.d.ts +1 -1
  68. package/declarations/app/components/table-header-toggle.d.ts +1 -1
  69. package/declarations/app/components/topic-drafts-dropdown.d.ts +1 -1
  70. package/declarations/app/components/topic-list/bulk-select-checkbox.d.ts +3 -0
  71. package/declarations/app/components/topic-list/bulk-select-checkbox.d.ts.map +1 -0
  72. package/declarations/app/components/topic-list/item/bulk-select-cell.d.ts.map +1 -1
  73. package/declarations/app/components/topic-list/item/replies-cell.d.ts +1 -1
  74. package/declarations/app/components/topic-list/item/topic-cell.d.ts +0 -2
  75. package/declarations/app/components/topic-list/item/topic-cell.d.ts.map +1 -1
  76. package/declarations/app/components/topic-list/item.d.ts.map +1 -1
  77. package/declarations/app/components/topic-map/topic-map-summary.d.ts +1 -1
  78. package/declarations/app/components/uppy-image-uploader.d.ts +1 -1
  79. package/declarations/app/components/welcome-banner.d.ts.map +1 -1
  80. package/declarations/app/controllers/review/index.d.ts +1 -1
  81. package/declarations/app/controllers/user-activity/bookmarks.d.ts +2 -2
  82. package/declarations/app/controllers/user-invited/show.d.ts +3 -1
  83. package/declarations/app/controllers/user-invited/show.d.ts.map +1 -1
  84. package/declarations/app/controllers/user.d.ts +2 -2
  85. package/declarations/app/form-kit/components/fk/control/color.d.ts +13 -0
  86. package/declarations/app/form-kit/components/fk/control/color.d.ts.map +1 -0
  87. package/declarations/app/form-kit/components/fk/control/password.d.ts +1 -1
  88. package/declarations/app/form-kit/components/fk/control-wrapper.d.ts.map +1 -1
  89. package/declarations/app/form-kit/components/fk/field.d.ts.map +1 -1
  90. package/declarations/app/lib/color-transformations.d.ts +3 -0
  91. package/declarations/app/lib/color-transformations.d.ts.map +1 -1
  92. package/declarations/app/lib/deprecated.d.ts.map +1 -1
  93. package/declarations/app/lib/notification-types/upcoming-change-automatically-promoted.d.ts +7 -0
  94. package/declarations/app/lib/notification-types/upcoming-change-automatically-promoted.d.ts.map +1 -0
  95. package/declarations/app/lib/notification-types/upcoming-change-available.d.ts +7 -0
  96. package/declarations/app/lib/notification-types/upcoming-change-available.d.ts.map +1 -0
  97. package/declarations/app/lib/notification-types-manager.d.ts.map +1 -1
  98. package/declarations/app/lib/optional-service.d.ts +2 -2
  99. package/declarations/app/lib/optional-service.d.ts.map +1 -1
  100. package/declarations/app/lib/render-tags.d.ts.map +1 -1
  101. package/declarations/app/lib/sidebar/admin-sidebar.d.ts.map +1 -1
  102. package/declarations/app/lib/sidebar/common/community-section/faq-section-link.d.ts +2 -2
  103. package/declarations/app/lib/sidebar/user/community-section/my-posts-section-link.d.ts +1 -1
  104. package/declarations/app/lib/uppy/s3-multipart.d.ts.map +1 -1
  105. package/declarations/app/lib/weak-value-map.d.ts +110 -0
  106. package/declarations/app/lib/weak-value-map.d.ts.map +1 -0
  107. package/declarations/app/models/badge.d.ts +1 -1
  108. package/declarations/app/models/bookmark.d.ts +3 -3
  109. package/declarations/app/models/group.d.ts +1 -1
  110. package/declarations/app/models/post-stream.d.ts +1 -1
  111. package/declarations/app/models/post.d.ts +1 -1
  112. package/declarations/app/models/reviewable.d.ts +1 -1
  113. package/declarations/app/models/tag-group.d.ts +1 -1
  114. package/declarations/app/models/user.d.ts +2 -1
  115. package/declarations/app/models/user.d.ts.map +1 -1
  116. package/declarations/app/routes/badges/index.d.ts +1 -1
  117. package/declarations/app/routes/badges/show.d.ts +1 -1
  118. package/declarations/app/routes/invites/show.d.ts +1 -1
  119. package/declarations/app/routes/second-factor-auth.d.ts +1 -1
  120. package/declarations/app/services/composer.d.ts +1 -1
  121. package/declarations/app/services/composer.d.ts.map +1 -1
  122. package/declarations/app/services/pm-topic-tracking-state.d.ts +1 -1
  123. package/declarations/app/services/search.d.ts +1 -1
  124. package/declarations/app/services/store.d.ts.map +1 -1
  125. package/declarations/app/static/prosemirror/core/serializer.d.ts +1 -0
  126. package/declarations/app/static/prosemirror/core/serializer.d.ts.map +1 -1
  127. package/declarations/select-kit/components/composer-actions.d.ts +1 -1
  128. package/declarations/select-kit/components/email-group-user-chooser.d.ts +1 -1
  129. package/declarations/tests/helpers/create-pretender.d.ts.map +1 -1
  130. package/declarations/tests/helpers/form-kit-assertions.d.ts.map +1 -1
  131. package/declarations/tests/helpers/form-kit-helper.d.ts +9 -1
  132. package/declarations/tests/helpers/form-kit-helper.d.ts.map +1 -1
  133. package/declarations/tests/helpers/qunit-helpers.d.ts +2 -1
  134. package/declarations/tests/helpers/qunit-helpers.d.ts.map +1 -1
  135. package/declarations/tests/helpers/site-settings.d.ts.map +1 -1
  136. package/declarations/tests/integration/components/form-kit/controls/color-test.d.ts +2 -0
  137. package/declarations/tests/integration/components/form-kit/controls/color-test.d.ts.map +1 -0
  138. package/declarations/tests/integration/components/site-settings/upload-test.d.ts +2 -0
  139. package/declarations/tests/integration/components/site-settings/upload-test.d.ts.map +1 -0
  140. package/declarations/tests/unit/lib/weak-value-map-test.d.ts +2 -0
  141. package/declarations/tests/unit/lib/weak-value-map-test.d.ts.map +1 -0
  142. package/declarations/tsconfig.tsbuildinfo +1 -1
  143. package/external-types/discourse-i18n/index.d.ts +69 -0
  144. package/external-types/discourse-i18n/package.json +44 -0
  145. package/external-types/ember-compat__tracked-built-ins/index.d.ts +174 -0
  146. package/external-types/{@ember-compat__tracked-built-ins → ember-compat__tracked-built-ins}/package.json +13 -12
  147. package/external-types/ember-modifier/index.d.ts +327 -0
  148. package/external-types/ember-modifier/package.json +12 -11
  149. package/external-types/ember-qunit/index.d.ts +285 -0
  150. package/external-types/ember-qunit/package.json +9 -8
  151. package/external-types/ember-source/package.json +5 -4
  152. package/external-types/ember__render-modifiers/index.d.ts +52 -0
  153. package/external-types/{@ember__render-modifiers → ember__render-modifiers}/package.json +4 -3
  154. package/external-types/ember__string/index.d.ts +159 -0
  155. package/external-types/{@ember__string → ember__string}/package.json +9 -8
  156. package/external-types/ember__test-helpers/index.d.ts +1771 -0
  157. package/external-types/{@ember__test-helpers → ember__test-helpers}/package.json +9 -8
  158. package/external-types/floating-ui__dom/index.d.ts +353 -0
  159. package/external-types/{@floating-ui__dom → floating-ui__dom}/package.json +3 -2
  160. package/external-types/glimmer__component/index.d.ts +667 -0
  161. package/external-types/{@glimmer__component → glimmer__component}/package.json +8 -7
  162. package/external-types/glimmer__syntax/index.d.ts +5792 -0
  163. package/external-types/{@glimmer__syntax → glimmer__syntax}/package.json +2 -1
  164. package/external-types/glint__template/index.d.ts +5422 -0
  165. package/external-types/{@glint__template → glint__template}/package.json +3 -2
  166. package/external-types/jquery/index.d.ts +34986 -0
  167. package/external-types/jquery/package.json +134 -0
  168. package/external-types/{@glint__template → pretender}/LICENSE +5 -7
  169. package/external-types/pretender/index.d.ts +60 -0
  170. package/external-types/pretender/package.json +76 -0
  171. package/external-types/qunit/index.d.ts +935 -0
  172. package/external-types/qunit/package.json +52 -0
  173. package/external-types/rsvp/LICENSE +21 -0
  174. package/external-types/rsvp/index.d.ts +493 -0
  175. package/external-types/rsvp/package.json +36 -0
  176. package/external-types/sinon/LICENSE +21 -0
  177. package/external-types/sinon/index.d.ts +1464 -0
  178. package/external-types/sinon/package.json +64 -0
  179. package/package.json +17 -2
  180. package/tsconfig-plugin.json +1 -1
  181. package/declarations/admin/compat-modules.d.ts +0 -3
  182. package/declarations/admin/compat-modules.d.ts.map +0 -1
  183. package/declarations/admin/controllers/admin-web-hooks/edit.d.ts +0 -19
  184. package/declarations/admin/controllers/admin-web-hooks/edit.d.ts.map +0 -1
  185. package/declarations/admin/controllers/admin-web-hooks/index.d.ts +0 -13
  186. package/declarations/admin/controllers/admin-web-hooks/index.d.ts.map +0 -1
  187. package/declarations/admin/templates/admin-config/welcome-banner.d.ts +0 -3
  188. package/declarations/admin/templates/admin-config/welcome-banner.d.ts.map +0 -1
  189. package/declarations/app/components/about-page-user.d.ts +0 -3
  190. package/declarations/app/components/about-page-user.d.ts.map +0 -1
  191. package/declarations/app/components/bootstrap-mode-notice.d.ts +0 -7
  192. package/declarations/app/components/bootstrap-mode-notice.d.ts.map +0 -1
  193. package/declarations/app/components/d-combo-button.d.ts +0 -3
  194. package/declarations/app/components/d-combo-button.d.ts.map +0 -1
  195. package/declarations/app/components/footer-message.d.ts +0 -5
  196. package/declarations/app/components/footer-message.d.ts.map +0 -1
  197. package/declarations/app/components/group-imap-email-settings.d.ts +0 -13
  198. package/declarations/app/components/group-imap-email-settings.d.ts.map +0 -1
  199. package/declarations/app/components/scrolling-post-stream.d.ts +0 -23
  200. package/declarations/app/components/scrolling-post-stream.d.ts.map +0 -1
  201. package/declarations/app/components/top-period-buttons.d.ts +0 -7
  202. package/declarations/app/components/top-period-buttons.d.ts.map +0 -1
  203. package/declarations/app/config/environment.d.ts +0 -3
  204. package/declarations/app/config/environment.d.ts.map +0 -1
  205. package/declarations/app/lib/autocomplete/emoji.d.ts +0 -4
  206. package/declarations/app/lib/autocomplete/emoji.d.ts.map +0 -1
  207. package/declarations/app/loader.d.ts +0 -4
  208. package/declarations/app/loader.d.ts.map +0 -1
  209. package/declarations/app/services/dialog.d.ts +0 -2
  210. package/declarations/app/services/dialog.d.ts.map +0 -1
  211. package/declarations/app/services/internal-tooltip.d.ts +0 -2
  212. package/declarations/app/services/internal-tooltip.d.ts.map +0 -1
  213. package/declarations/app/services/menu.d.ts +0 -2
  214. package/declarations/app/services/menu.d.ts.map +0 -1
  215. package/declarations/app/services/toasts.d.ts +0 -2
  216. package/declarations/app/services/toasts.d.ts.map +0 -1
  217. package/declarations/app/services/tooltip.d.ts +0 -2
  218. package/declarations/app/services/tooltip.d.ts.map +0 -1
  219. package/declarations/app/static/wizard/components/fields/checkbox.d.ts +0 -5
  220. package/declarations/app/static/wizard/components/fields/checkbox.d.ts.map +0 -1
  221. package/declarations/app/static/wizard/components/fields/checkboxes.d.ts +0 -7
  222. package/declarations/app/static/wizard/components/fields/checkboxes.d.ts.map +0 -1
  223. package/declarations/app/static/wizard/components/fields/image-previews/generic.d.ts +0 -5
  224. package/declarations/app/static/wizard/components/fields/image-previews/generic.d.ts.map +0 -1
  225. package/declarations/app/static/wizard/components/fields/image-previews/index.d.ts +0 -9
  226. package/declarations/app/static/wizard/components/fields/image-previews/index.d.ts.map +0 -1
  227. package/declarations/app/static/wizard/components/fields/image-previews/logo-small.d.ts +0 -13
  228. package/declarations/app/static/wizard/components/fields/image-previews/logo-small.d.ts.map +0 -1
  229. package/declarations/app/static/wizard/components/fields/image-previews/logo.d.ts +0 -19
  230. package/declarations/app/static/wizard/components/fields/image-previews/logo.d.ts.map +0 -1
  231. package/declarations/app/static/wizard/components/fields/image.d.ts +0 -15
  232. package/declarations/app/static/wizard/components/fields/image.d.ts.map +0 -1
  233. package/declarations/app/static/wizard/components/fields/styling-preview/-homepage-preview.d.ts +0 -29
  234. package/declarations/app/static/wizard/components/fields/styling-preview/-homepage-preview.d.ts.map +0 -1
  235. package/declarations/app/static/wizard/components/fields/styling-preview/-preview-base.d.ts +0 -34
  236. package/declarations/app/static/wizard/components/fields/styling-preview/-preview-base.d.ts.map +0 -1
  237. package/declarations/app/static/wizard/components/fields/styling-preview/index.d.ts +0 -38
  238. package/declarations/app/static/wizard/components/fields/styling-preview/index.d.ts.map +0 -1
  239. package/declarations/app/static/wizard/components/wizard-canvas.d.ts +0 -14
  240. package/declarations/app/static/wizard/components/wizard-canvas.d.ts.map +0 -1
  241. package/declarations/app/widgets/actions-summary.d.ts +0 -2
  242. package/declarations/app/widgets/actions-summary.d.ts.map +0 -1
  243. package/declarations/app/widgets/bookmark-menu.d.ts +0 -2
  244. package/declarations/app/widgets/bookmark-menu.d.ts.map +0 -1
  245. package/declarations/app/widgets/post-user-tip-shim.d.ts +0 -2
  246. package/declarations/app/widgets/post-user-tip-shim.d.ts.map +0 -1
  247. package/declarations/app/widgets/topic-status.d.ts +0 -2
  248. package/declarations/app/widgets/topic-status.d.ts.map +0 -1
  249. package/declarations/select-kit/compat-modules.d.ts +0 -3
  250. package/declarations/select-kit/compat-modules.d.ts.map +0 -1
  251. package/declarations/tests/acceptance/bootstrap-mode-notice-test.d.ts +0 -2
  252. package/declarations/tests/acceptance/bootstrap-mode-notice-test.d.ts.map +0 -1
  253. package/declarations/tests/integration/components/widgets/actions-summary-test.d.ts +0 -2
  254. package/declarations/tests/integration/components/widgets/actions-summary-test.d.ts.map +0 -1
  255. package/declarations/tests/integration/components/widgets/avatar-flair-test.d.ts +0 -2
  256. package/declarations/tests/integration/components/widgets/avatar-flair-test.d.ts.map +0 -1
  257. package/declarations/tests/integration/components/widgets/button-test.d.ts +0 -2
  258. package/declarations/tests/integration/components/widgets/button-test.d.ts.map +0 -1
  259. package/declarations/tests/integration/components/widgets/post-cooked-test.d.ts +0 -2
  260. package/declarations/tests/integration/components/widgets/post-cooked-test.d.ts.map +0 -1
  261. package/declarations/tests/integration/components/widgets/post-links-test.d.ts +0 -2
  262. package/declarations/tests/integration/components/widgets/post-links-test.d.ts.map +0 -1
  263. package/declarations/tests/integration/components/widgets/post-small-action-test.d.ts +0 -2
  264. package/declarations/tests/integration/components/widgets/post-small-action-test.d.ts.map +0 -1
  265. package/declarations/tests/integration/components/widgets/post-stream-test.d.ts +0 -2
  266. package/declarations/tests/integration/components/widgets/post-stream-test.d.ts.map +0 -1
  267. package/declarations/tests/integration/components/widgets/post-test.d.ts +0 -2
  268. package/declarations/tests/integration/components/widgets/post-test.d.ts.map +0 -1
  269. package/declarations/tests/integration/components/widgets/poster-name-test.d.ts +0 -2
  270. package/declarations/tests/integration/components/widgets/poster-name-test.d.ts.map +0 -1
  271. package/declarations/tests/integration/components/widgets/render-glimmer-test.d.ts +0 -1
  272. package/declarations/tests/integration/components/widgets/render-glimmer-test.d.ts.map +0 -1
  273. package/declarations/tests/integration/components/widgets/small-user-list-test.d.ts +0 -2
  274. package/declarations/tests/integration/components/widgets/small-user-list-test.d.ts.map +0 -1
  275. package/declarations/tests/integration/components/widgets/topic-status-test.d.ts +0 -2
  276. package/declarations/tests/integration/components/widgets/topic-status-test.d.ts.map +0 -1
  277. package/declarations/tests/integration/components/widgets/widget-dropdown-test.d.ts +0 -2
  278. package/declarations/tests/integration/components/widgets/widget-dropdown-test.d.ts.map +0 -1
  279. package/declarations/tests/integration/components/widgets/widget-test.d.ts +0 -2
  280. package/declarations/tests/integration/components/widgets/widget-test.d.ts.map +0 -1
  281. package/declarations/tests/set-test-env.d.ts +0 -2
  282. package/declarations/tests/set-test-env.d.ts.map +0 -1
  283. package/declarations/tests/test-i18n.d.ts +0 -1
  284. package/declarations/tests/test-i18n.d.ts.map +0 -1
  285. package/external-types/@ember-compat__tracked-built-ins/dist/-private/array.d.ts +0 -33
  286. package/external-types/@ember-compat__tracked-built-ins/dist/-private/decorator.d.ts +0 -14
  287. package/external-types/@ember-compat__tracked-built-ins/dist/-private/map.d.ts +0 -44
  288. package/external-types/@ember-compat__tracked-built-ins/dist/-private/object.d.ts +0 -25
  289. package/external-types/@ember-compat__tracked-built-ins/dist/-private/property-storage-map.d.ts +0 -10
  290. package/external-types/@ember-compat__tracked-built-ins/dist/-private/set.d.ts +0 -40
  291. package/external-types/@ember-compat__tracked-built-ins/dist/-private/utils.d.ts +0 -6
  292. package/external-types/@ember-compat__tracked-built-ins/dist/-private/validator-versions.d.ts +0 -5
  293. package/external-types/@ember-compat__tracked-built-ins/dist/index.d.ts +0 -8
  294. package/external-types/@ember__render-modifiers/types/-private.d.ts +0 -13
  295. package/external-types/@ember__render-modifiers/types/modifiers/did-insert.d.ts +0 -11
  296. package/external-types/@ember__render-modifiers/types/modifiers/did-update.d.ts +0 -11
  297. package/external-types/@ember__render-modifiers/types/modifiers/will-destroy.d.ts +0 -11
  298. package/external-types/@ember__render-modifiers/types/template-registry.d.ts +0 -12
  299. package/external-types/@ember__string/declarations/index.d.ts +0 -159
  300. package/external-types/@ember__test-helpers/declarations/-internal/build-registry.d.ts +0 -36
  301. package/external-types/@ember__test-helpers/declarations/-internal/debug-info-helpers.d.ts +0 -28
  302. package/external-types/@ember__test-helpers/declarations/-internal/debug-info.d.ts +0 -71
  303. package/external-types/@ember__test-helpers/declarations/-internal/deprecations.d.ts +0 -37
  304. package/external-types/@ember__test-helpers/declarations/-internal/is-component.d.ts +0 -13
  305. package/external-types/@ember__test-helpers/declarations/-internal/is-promise.d.ts +0 -12
  306. package/external-types/@ember__test-helpers/declarations/-internal/render-settled.d.ts +0 -5
  307. package/external-types/@ember__test-helpers/declarations/-internal/warnings.d.ts +0 -32
  308. package/external-types/@ember__test-helpers/declarations/-tuple.d.ts +0 -5
  309. package/external-types/@ember__test-helpers/declarations/-utils.d.ts +0 -39
  310. package/external-types/@ember__test-helpers/declarations/application.d.ts +0 -21
  311. package/external-types/@ember__test-helpers/declarations/build-owner.d.ts +0 -35
  312. package/external-types/@ember__test-helpers/declarations/dom/-get-description.d.ts +0 -13
  313. package/external-types/@ember__test-helpers/declarations/dom/-get-element.d.ts +0 -16
  314. package/external-types/@ember__test-helpers/declarations/dom/-get-elements.d.ts +0 -8
  315. package/external-types/@ember__test-helpers/declarations/dom/-get-window-or-element.d.ts +0 -12
  316. package/external-types/@ember__test-helpers/declarations/dom/-guard-for-maxlength.d.ts +0 -12
  317. package/external-types/@ember__test-helpers/declarations/dom/-is-focusable.d.ts +0 -9
  318. package/external-types/@ember__test-helpers/declarations/dom/-is-form-control.d.ts +0 -10
  319. package/external-types/@ember__test-helpers/declarations/dom/-is-select-element.d.ts +0 -9
  320. package/external-types/@ember__test-helpers/declarations/dom/-logging.d.ts +0 -21
  321. package/external-types/@ember__test-helpers/declarations/dom/-target.d.ts +0 -12
  322. package/external-types/@ember__test-helpers/declarations/dom/-to-array.d.ts +0 -9
  323. package/external-types/@ember__test-helpers/declarations/dom/blur.d.ts +0 -37
  324. package/external-types/@ember__test-helpers/declarations/dom/click.d.ts +0 -65
  325. package/external-types/@ember__test-helpers/declarations/dom/double-click.d.ts +0 -65
  326. package/external-types/@ember__test-helpers/declarations/dom/fill-in.d.ts +0 -22
  327. package/external-types/@ember__test-helpers/declarations/dom/find-all.d.ts +0 -7
  328. package/external-types/@ember__test-helpers/declarations/dom/find.d.ts +0 -7
  329. package/external-types/@ember__test-helpers/declarations/dom/fire-event.d.ts +0 -18
  330. package/external-types/@ember__test-helpers/declarations/dom/focus.d.ts +0 -41
  331. package/external-types/@ember__test-helpers/declarations/dom/get-root-element.d.ts +0 -17
  332. package/external-types/@ember__test-helpers/declarations/dom/scroll-to.d.ts +0 -21
  333. package/external-types/@ember__test-helpers/declarations/dom/select.d.ts +0 -28
  334. package/external-types/@ember__test-helpers/declarations/dom/tab.d.ts +0 -31
  335. package/external-types/@ember__test-helpers/declarations/dom/tap.d.ts +0 -47
  336. package/external-types/@ember__test-helpers/declarations/dom/trigger-event.d.ts +0 -49
  337. package/external-types/@ember__test-helpers/declarations/dom/trigger-key-event.d.ts +0 -44
  338. package/external-types/@ember__test-helpers/declarations/dom/type-in.d.ts +0 -32
  339. package/external-types/@ember__test-helpers/declarations/dom/wait-for-focus.d.ts +0 -27
  340. package/external-types/@ember__test-helpers/declarations/dom/wait-for.d.ts +0 -27
  341. package/external-types/@ember__test-helpers/declarations/global.d.ts +0 -5
  342. package/external-types/@ember__test-helpers/declarations/has-ember-version.d.ts +0 -13
  343. package/external-types/@ember__test-helpers/declarations/helper-hooks.d.ts +0 -48
  344. package/external-types/@ember__test-helpers/declarations/index.d.ts +0 -49
  345. package/external-types/@ember__test-helpers/declarations/rerender.d.ts +0 -20
  346. package/external-types/@ember__test-helpers/declarations/resolver.d.ts +0 -21
  347. package/external-types/@ember__test-helpers/declarations/settled.d.ts +0 -72
  348. package/external-types/@ember__test-helpers/declarations/setup-application-context.d.ts +0 -69
  349. package/external-types/@ember__test-helpers/declarations/setup-context.d.ts +0 -209
  350. package/external-types/@ember__test-helpers/declarations/setup-onerror.d.ts +0 -53
  351. package/external-types/@ember__test-helpers/declarations/setup-rendering-context.d.ts +0 -75
  352. package/external-types/@ember__test-helpers/declarations/teardown-context.d.ts +0 -23
  353. package/external-types/@ember__test-helpers/declarations/test-metadata.d.ts +0 -28
  354. package/external-types/@ember__test-helpers/declarations/validate-error-handler.d.ts +0 -35
  355. package/external-types/@ember__test-helpers/declarations/wait-until.d.ts +0 -31
  356. package/external-types/@floating-ui__dom/dist/floating-ui.dom.d.mts +0 -356
  357. package/external-types/@floating-ui__dom/dist/floating-ui.dom.d.ts +0 -359
  358. package/external-types/@glimmer__component/dist/-private/base-component-manager.d.ts +0 -15
  359. package/external-types/@glimmer__component/dist/-private/component.d.ts +0 -247
  360. package/external-types/@glimmer__component/dist/-private/ember-component-manager.d.ts +0 -20
  361. package/external-types/@glimmer__component/dist/index.d.ts +0 -393
  362. package/external-types/@glimmer__syntax/dist/dev/index.d.cts +0 -5977
  363. package/external-types/@glimmer__syntax/dist/dev/index.d.ts +0 -5979
  364. package/external-types/@glimmer__syntax/dist/prod/index.d.ts +0 -5977
  365. package/external-types/@glint__ember-tsc/lib/cli/run-volar-tsc.d.ts +0 -4
  366. package/external-types/@glint__ember-tsc/lib/config/config.d.ts +0 -17
  367. package/external-types/@glint__ember-tsc/lib/config/environment.d.ts +0 -28
  368. package/external-types/@glint__ember-tsc/lib/config/index.d.ts +0 -19
  369. package/external-types/@glint__ember-tsc/lib/config/loader.d.ts +0 -27
  370. package/external-types/@glint__ember-tsc/lib/config/types.d.cts +0 -62
  371. package/external-types/@glint__ember-tsc/lib/environment-ember-template-imports/-private/environment/common.d.ts +0 -15
  372. package/external-types/@glint__ember-tsc/lib/environment-ember-template-imports/-private/environment/index.d.ts +0 -5
  373. package/external-types/@glint__ember-tsc/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts +0 -6
  374. package/external-types/@glint__ember-tsc/lib/environment-ember-template-imports/-private/environment/transform.d.ts +0 -6
  375. package/external-types/@glint__ember-tsc/lib/index.d.ts +0 -9
  376. package/external-types/@glint__ember-tsc/lib/plugins/g-compiler-errors.d.ts +0 -14
  377. package/external-types/@glint__ember-tsc/lib/plugins/g-template-tag-symbols.d.ts +0 -13
  378. package/external-types/@glint__ember-tsc/lib/plugins/utils.d.ts +0 -27
  379. package/external-types/@glint__ember-tsc/lib/transform/diagnostics/augmentation.d.ts +0 -6
  380. package/external-types/@glint__ember-tsc/lib/transform/diagnostics/index.d.ts +0 -7
  381. package/external-types/@glint__ember-tsc/lib/transform/index.d.ts +0 -6
  382. package/external-types/@glint__ember-tsc/lib/transform/template/code-features.d.ts +0 -32
  383. package/external-types/@glint__ember-tsc/lib/transform/template/glimmer-ast-mapping-tree.d.ts +0 -82
  384. package/external-types/@glint__ember-tsc/lib/transform/template/inlining/index.d.ts +0 -18
  385. package/external-types/@glint__ember-tsc/lib/transform/template/inlining/tagged-strings.d.ts +0 -10
  386. package/external-types/@glint__ember-tsc/lib/transform/template/map-template-contents.d.ts +0 -123
  387. package/external-types/@glint__ember-tsc/lib/transform/template/rewrite-module.d.ts +0 -24
  388. package/external-types/@glint__ember-tsc/lib/transform/template/scope-stack.d.ts +0 -15
  389. package/external-types/@glint__ember-tsc/lib/transform/template/template-to-typescript.d.ts +0 -21
  390. package/external-types/@glint__ember-tsc/lib/transform/template/transformed-module.d.ts +0 -113
  391. package/external-types/@glint__ember-tsc/lib/transform/util.d.ts +0 -9
  392. package/external-types/@glint__ember-tsc/lib/volar/ember-language-plugin.d.ts +0 -16
  393. package/external-types/@glint__ember-tsc/lib/volar/gts-virtual-code.d.ts +0 -85
  394. package/external-types/@glint__ember-tsc/lib/volar/language-server.d.ts +0 -4
  395. package/external-types/@glint__ember-tsc/lib/volar/script-snapshot.d.ts +0 -19
  396. package/external-types/@glint__ember-tsc/package.json +0 -104
  397. package/external-types/@glint__ember-tsc/types/-private/dsl/globals.d.ts +0 -207
  398. package/external-types/@glint__ember-tsc/types/-private/dsl/index.d.ts +0 -50
  399. package/external-types/@glint__ember-tsc/types/-private/dsl/integration-declarations.d.ts +0 -138
  400. package/external-types/@glint__ember-tsc/types/-private/intrinsics/action.d.ts +0 -48
  401. package/external-types/@glint__ember-tsc/types/-private/intrinsics/concat.d.ts +0 -9
  402. package/external-types/@glint__ember-tsc/types/-private/intrinsics/each-in.d.ts +0 -27
  403. package/external-types/@glint__ember-tsc/types/-private/intrinsics/each.d.ts +0 -20
  404. package/external-types/@glint__ember-tsc/types/-private/intrinsics/fn.d.ts +0 -47
  405. package/external-types/@glint__ember-tsc/types/-private/intrinsics/get.d.ts +0 -34
  406. package/external-types/@glint__ember-tsc/types/-private/intrinsics/input.d.ts +0 -24
  407. package/external-types/@glint__ember-tsc/types/-private/intrinsics/link-to.d.ts +0 -31
  408. package/external-types/@glint__ember-tsc/types/-private/intrinsics/log.d.ts +0 -9
  409. package/external-types/@glint__ember-tsc/types/-private/intrinsics/mount.d.ts +0 -12
  410. package/external-types/@glint__ember-tsc/types/-private/intrinsics/mut.d.ts +0 -17
  411. package/external-types/@glint__ember-tsc/types/-private/intrinsics/on.d.ts +0 -24
  412. package/external-types/@glint__ember-tsc/types/-private/intrinsics/outlet.d.ts +0 -11
  413. package/external-types/@glint__ember-tsc/types/-private/intrinsics/textarea.d.ts +0 -16
  414. package/external-types/@glint__ember-tsc/types/-private/intrinsics/unbound.d.ts +0 -13
  415. package/external-types/@glint__ember-tsc/types/-private/intrinsics/unique-id.d.ts +0 -8
  416. package/external-types/@glint__ember-tsc/types/globals/index.d.ts +0 -6
  417. package/external-types/@glint__ember-tsc/types/silent-error.d.ts +0 -4
  418. package/external-types/@glint__template/-private/dsl/elements.d.ts +0 -4393
  419. package/external-types/@glint__template/-private/dsl/emit.d.ts +0 -178
  420. package/external-types/@glint__template/-private/dsl/lib.dom.augmentation.d.ts +0 -144
  421. package/external-types/@glint__template/-private/dsl/resolve.d.ts +0 -69
  422. package/external-types/@glint__template/-private/dsl/types.d.ts +0 -63
  423. package/external-types/@glint__template/-private/dsl.d.ts +0 -10
  424. package/external-types/@glint__template/-private/index.d.ts +0 -187
  425. package/external-types/@glint__template/-private/integration.d.ts +0 -82
  426. package/external-types/@glint__template/-private/keywords/-bind-invokable.d.ts +0 -98
  427. package/external-types/@glint__template/-private/keywords/component.d.ts +0 -7
  428. package/external-types/@glint__template/-private/keywords/debugger.d.ts +0 -6
  429. package/external-types/@glint__template/-private/keywords/each.d.ts +0 -19
  430. package/external-types/@glint__template/-private/keywords/has-block-params.d.ts +0 -9
  431. package/external-types/@glint__template/-private/keywords/has-block.d.ts +0 -9
  432. package/external-types/@glint__template/-private/keywords/helper.d.ts +0 -6
  433. package/external-types/@glint__template/-private/keywords/in-element.d.ts +0 -16
  434. package/external-types/@glint__template/-private/keywords/let.d.ts +0 -12
  435. package/external-types/@glint__template/-private/keywords/modifier.d.ts +0 -7
  436. package/external-types/@glint__template/-private/keywords/with.d.ts +0 -16
  437. package/external-types/@glint__template/-private/keywords.d.ts +0 -13
  438. package/external-types/@glint__template/-private/signature.d.ts +0 -86
  439. package/external-types/@types__qunit/index.d.ts +0 -935
  440. package/external-types/@types__qunit/package.json +0 -51
  441. package/external-types/@types__rsvp/index.d.ts +0 -497
  442. package/external-types/@types__rsvp/package.json +0 -35
  443. package/external-types/ember-modifier/declarations/-private/class-based/modifier-manager.d.ts +0 -43
  444. package/external-types/ember-modifier/declarations/-private/class-based/modifier.d.ts +0 -66
  445. package/external-types/ember-modifier/declarations/-private/function-based/modifier-manager.d.ts +0 -25
  446. package/external-types/ember-modifier/declarations/-private/function-based/modifier.d.ts +0 -71
  447. package/external-types/ember-modifier/declarations/-private/opaque.d.ts +0 -10
  448. package/external-types/ember-modifier/declarations/-private/signature.d.ts +0 -107
  449. package/external-types/ember-modifier/declarations/index.d.ts +0 -7
  450. package/external-types/ember-qunit/types/index.d.ts +0 -285
  451. package/external-types/ember-qunit/types/local-types.d.ts +0 -5
  452. package/external-types/ember-qunit/types/test-loader.d.ts +0 -4
  453. package/external-types.d.ts +0 -102
  454. /package/external-types/{@ember-compat__tracked-built-ins → ember-compat__tracked-built-ins}/LICENSE.md +0 -0
  455. /package/external-types/{@ember__render-modifiers → ember__render-modifiers}/LICENSE.md +0 -0
  456. /package/external-types/{@ember__string → ember__string}/LICENSE.md +0 -0
  457. /package/external-types/{@floating-ui__dom → floating-ui__dom}/LICENSE +0 -0
  458. /package/external-types/{@glimmer__syntax → glimmer__syntax}/LICENSE +0 -0
  459. /package/external-types/{@glint__ember-tsc → glint__template}/LICENSE +0 -0
  460. /package/external-types/{@types__qunit → jquery}/LICENSE +0 -0
  461. /package/external-types/{@types__rsvp → qunit}/LICENSE +0 -0
@@ -0,0 +1,1464 @@
1
+ declare module 'sinon' {
2
+ import * as FakeTimers from '@sinonjs/fake-timers';
3
+
4
+ // sinon uses DOM dependencies which are absent in browser-less environment like node.js
5
+ // to avoid compiler errors this monkey patch is used
6
+ // see more details in https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11351
7
+ interface Event {} // eslint-disable-line @typescript-eslint/no-empty-interface
8
+ interface Document {} namespace Sinon {
9
+ type MatchPartialArguments<T> = {
10
+ [K in keyof T]?: SinonMatcher | (T[K] extends object ? MatchPartialArguments<T[K]> : T[K]);
11
+ };
12
+ // TODO: Alias for backward compatibility, remove on next major release
13
+ type DeepPartialOrMatcher<T> = MatchPartialArguments<T>;
14
+
15
+ type MatchExactArguments<T> = {
16
+ [K in keyof T]: SinonMatcher | (T[K] extends object ? MatchExactArguments<T[K]> : T[K]);
17
+ };
18
+ // TODO: Alias for backward compatibility, remove on next major release
19
+ type MatchArguments<T> = MatchExactArguments<T>;
20
+
21
+ interface SinonSpyCallApi<TArgs extends readonly any[] = any[], TReturnValue = any> {
22
+ // Properties
23
+ /**
24
+ * Array of received arguments.
25
+ */
26
+ args: TArgs;
27
+
28
+ // Methods
29
+ /**
30
+ * Returns true if the spy was called at least once with @param obj as this.
31
+ * calledOn also accepts a matcher spyCall.calledOn(sinon.match(fn)) (see matchers).
32
+ * @param obj
33
+ */
34
+ calledOn(obj: any): boolean;
35
+ /**
36
+ * Returns true if spy was called at least once with the provided arguments.
37
+ * Can be used for partial matching, Sinon only checks the provided arguments against actual arguments,
38
+ * so a call that received the provided arguments (in the same spots) and possibly others as well will return true.
39
+ * @param args
40
+ */
41
+ calledWith(...args: MatchPartialArguments<TArgs>): boolean;
42
+ /**
43
+ * Returns true if spy was called at least once with the provided arguments and no others.
44
+ */
45
+ calledWithExactly(...args: MatchExactArguments<TArgs>): boolean;
46
+ /**
47
+ * Returns true if spy/stub was called the new operator.
48
+ * Beware that this is inferred based on the value of the this object and the spy function’s prototype,
49
+ * so it may give false positives if you actively return the right kind of object.
50
+ */
51
+ calledWithNew(): boolean;
52
+ /**
53
+ * Returns true if spy was called at exactly once with the provided arguments.
54
+ * @param args
55
+ */
56
+ calledOnceWith(...args: MatchPartialArguments<TArgs>): boolean;
57
+ calledOnceWithExactly(...args: MatchExactArguments<TArgs>): boolean;
58
+ /**
59
+ * Returns true if spy was called with matching arguments (and possibly others).
60
+ * This behaves the same as spy.calledWith(sinon.match(arg1), sinon.match(arg2), ...).
61
+ * @param args
62
+ */
63
+ calledWithMatch(...args: MatchPartialArguments<TArgs>): boolean;
64
+ /**
65
+ * Returns true if call did not receive provided arguments.
66
+ * @param args
67
+ */
68
+ notCalledWith(...args: MatchExactArguments<TArgs>): boolean;
69
+ /**
70
+ * Returns true if call did not receive matching arguments.
71
+ * This behaves the same as spyCall.notCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
72
+ * @param args
73
+ */
74
+ notCalledWithMatch(...args: MatchPartialArguments<TArgs>): boolean;
75
+ /**
76
+ * Returns true if spy returned the provided value at least once.
77
+ * Uses deep comparison for objects and arrays. Use spy.returned(sinon.match.same(obj)) for strict comparison (see matchers).
78
+ * @param value
79
+ */
80
+ returned(value: TReturnValue | SinonMatcher): boolean;
81
+ /**
82
+ * Returns true if spy threw an exception at least once.
83
+ */
84
+ threw(): boolean;
85
+ /**
86
+ * Returns true if spy threw an exception of the provided type at least once.
87
+ */
88
+ threw(type: string): boolean;
89
+ /**
90
+ * Returns true if spy threw the provided exception object at least once.
91
+ */
92
+ threw(obj: any): boolean;
93
+ /**
94
+ * Like yield, but with an explicit argument number specifying which callback to call.
95
+ * Useful if a function is called with more than one callback, and simply calling the first callback is not desired.
96
+ * @param pos
97
+ */
98
+ callArg(pos: number): unknown[];
99
+ callArgOn(pos: number, obj: any, ...args: any[]): unknown[];
100
+ /**
101
+ * Like callArg, but with arguments.
102
+ */
103
+ callArgWith(pos: number, ...args: any[]): unknown[];
104
+ callArgOnWith(pos: number, obj: any, ...args: any[]): unknown[];
105
+ /**
106
+ * Invoke callbacks passed to the stub with the given arguments.
107
+ * If the stub was never called with a function argument, yield throws an error.
108
+ * Returns an Array with all callbacks return values in the order they were called, if no error is thrown.
109
+ * Also aliased as invokeCallback.
110
+ */
111
+ yield(...args: any[]): unknown[];
112
+ yieldOn(obj: any, ...args: any[]): unknown[];
113
+ /**
114
+ * Invokes callbacks passed as a property of an object to the stub.
115
+ * Like yield, yieldTo grabs the first matching argument, finds the callback and calls it with the (optional) arguments.
116
+ */
117
+ yieldTo(property: string, ...args: any[]): unknown[];
118
+ yieldToOn(property: string, obj: any, ...args: any[]): unknown[];
119
+ }
120
+
121
+ interface SinonSpyCall<TArgs extends readonly any[] = any[], TReturnValue = any>
122
+ extends SinonSpyCallApi<TArgs, TReturnValue>
123
+ {
124
+ /**
125
+ * The call’s this value.
126
+ */
127
+ thisValue: any;
128
+ /**
129
+ * Exception thrown, if any.
130
+ */
131
+ exception: any;
132
+ /**
133
+ * Return value.
134
+ */
135
+ returnValue: TReturnValue;
136
+ /**
137
+ * This property is a convenience for a call’s callback.
138
+ * When the last argument in a call is a Function, then callback will reference that. Otherwise it will be undefined.
139
+ */
140
+ callback: Function | undefined;
141
+
142
+ /**
143
+ * This property is a convenience for the first argument of the call.
144
+ */
145
+ firstArg: any;
146
+
147
+ /**
148
+ * This property is a convenience for the last argument of the call.
149
+ */
150
+ lastArg: any;
151
+
152
+ /**
153
+ * Returns true if the spy call occurred before another spy call.
154
+ * @param call
155
+ */
156
+ calledBefore(call: SinonSpyCall<any>): boolean;
157
+ /**
158
+ * Returns true if the spy call occurred after another spy call.
159
+ * @param call
160
+ */
161
+ calledAfter(call: SinonSpyCall<any>): boolean;
162
+ }
163
+
164
+ interface SinonSpy<TArgs extends readonly any[] = any[], TReturnValue = any> extends
165
+ Pick<
166
+ SinonSpyCallApi<TArgs, TReturnValue>,
167
+ Exclude<keyof SinonSpyCallApi<TArgs, TReturnValue>, "args">
168
+ >
169
+ {
170
+ // Properties
171
+ /**
172
+ * The number of recorded calls.
173
+ */
174
+ callCount: number;
175
+ /**
176
+ * true if the spy was called at least once
177
+ */
178
+ called: boolean;
179
+ /**
180
+ * true if the spy was not called
181
+ */
182
+ notCalled: boolean;
183
+ /**
184
+ * true if spy was called exactly once
185
+ */
186
+ calledOnce: boolean;
187
+ /**
188
+ * true if the spy was called exactly twice
189
+ */
190
+ calledTwice: boolean;
191
+ /**
192
+ * true if the spy was called exactly thrice
193
+ */
194
+ calledThrice: boolean;
195
+ /**
196
+ * The first call
197
+ */
198
+ firstCall: SinonSpyCall<TArgs, TReturnValue>;
199
+ /**
200
+ * The second call
201
+ */
202
+ secondCall: SinonSpyCall<TArgs, TReturnValue>;
203
+ /**
204
+ * The third call
205
+ */
206
+ thirdCall: SinonSpyCall<TArgs, TReturnValue>;
207
+ /**
208
+ * The last call
209
+ */
210
+ lastCall: SinonSpyCall<TArgs, TReturnValue>;
211
+ /**
212
+ * Array of this objects, spy.thisValues[0] is the this object for the first call.
213
+ */
214
+ thisValues: any[];
215
+ /**
216
+ * Array of arguments received, spy.args[0] is an array of arguments received in the first call.
217
+ */
218
+ args: TArgs[];
219
+ /**
220
+ * Array of exception objects thrown, spy.exceptions[0] is the exception thrown by the first call.
221
+ * If the call did not throw an error, the value at the call’s location in .exceptions will be undefined.
222
+ */
223
+ exceptions: any[];
224
+ /**
225
+ * Array of return values, spy.returnValues[0] is the return value of the first call.
226
+ * If the call did not explicitly return a value, the value at the call’s location in .returnValues will be undefined.
227
+ */
228
+ returnValues: TReturnValue[];
229
+
230
+ /**
231
+ * Holds a reference to the original method/function this stub has wrapped.
232
+ */
233
+ wrappedMethod: (...args: TArgs) => TReturnValue;
234
+
235
+ // Methods
236
+ (...args: TArgs): TReturnValue;
237
+
238
+ /**
239
+ * Returns true if the spy was called before @param anotherSpy
240
+ * @param anotherSpy
241
+ */
242
+ calledBefore(anotherSpy: SinonSpy<any>): boolean;
243
+ /**
244
+ * Returns true if the spy was called after @param anotherSpy
245
+ * @param anotherSpy
246
+ */
247
+ calledAfter(anotherSpy: SinonSpy<any>): boolean;
248
+ /**
249
+ * Returns true if spy was called before @param anotherSpy, and no spy calls occurred between spy and @param anotherSpy.
250
+ * @param anotherSpy
251
+ */
252
+ calledImmediatelyBefore(anotherSpy: SinonSpy<any>): boolean;
253
+ /**
254
+ * Returns true if spy was called after @param anotherSpy, and no spy calls occurred between @param anotherSpy and spy.
255
+ * @param anotherSpy
256
+ */
257
+ calledImmediatelyAfter(anotherSpy: SinonSpy<any>): boolean;
258
+
259
+ /**
260
+ * Creates a spy that only records calls when the received arguments match those passed to withArgs.
261
+ * This is useful to be more expressive in your assertions, where you can access the spy with the same call.
262
+ * @param args Expected args
263
+ */
264
+ withArgs(...args: MatchPartialArguments<TArgs>): SinonSpy<TArgs, TReturnValue>;
265
+ /**
266
+ * Returns true if the spy was always called with @param obj as this.
267
+ * @param obj
268
+ */
269
+ alwaysCalledOn(obj: any): boolean;
270
+ /**
271
+ * Returns true if spy was always called with the provided arguments (and possibly others).
272
+ */
273
+ alwaysCalledWith(...args: MatchExactArguments<TArgs>): boolean;
274
+ /**
275
+ * Returns true if spy was always called with the exact provided arguments.
276
+ * @param args
277
+ */
278
+ alwaysCalledWithExactly(...args: MatchExactArguments<TArgs>): boolean;
279
+ /**
280
+ * Returns true if spy was always called with matching arguments (and possibly others).
281
+ * This behaves the same as spy.alwaysCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
282
+ * @param args
283
+ */
284
+ alwaysCalledWithMatch(...args: TArgs): boolean;
285
+ /**
286
+ * Returns true if the spy/stub was never called with the provided arguments.
287
+ * @param args
288
+ */
289
+ neverCalledWith(...args: MatchExactArguments<TArgs>): boolean;
290
+ /**
291
+ * Returns true if the spy/stub was never called with matching arguments.
292
+ * This behaves the same as spy.neverCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
293
+ * @param args
294
+ */
295
+ neverCalledWithMatch(...args: TArgs): boolean;
296
+ /**
297
+ * Returns true if spy always threw an exception.
298
+ */
299
+ alwaysThrew(): boolean;
300
+ /**
301
+ * Returns true if spy always threw an exception of the provided type.
302
+ */
303
+ alwaysThrew(type: string): boolean;
304
+ /**
305
+ * Returns true if spy always threw the provided exception object.
306
+ */
307
+ alwaysThrew(obj: any): boolean;
308
+ /**
309
+ * Returns true if spy always returned the provided value.
310
+ * @param obj
311
+ */
312
+ alwaysReturned(obj: any): boolean;
313
+ /**
314
+ * Invoke callbacks passed to the stub with the given arguments.
315
+ * If the stub was never called with a function argument, yield throws an error.
316
+ * Returns an Array with all callbacks return values in the order they were called, if no error is thrown.
317
+ */
318
+ invokeCallback(...args: TArgs): void;
319
+ /**
320
+ * Set the displayName of the spy or stub.
321
+ * @param name
322
+ */
323
+ named(name: string): SinonSpy<TArgs, TReturnValue>;
324
+ /**
325
+ * Returns the nth call.
326
+ * Accessing individual calls helps with more detailed behavior verification when the spy is called more than once.
327
+ * @param n Zero-based index of the spy call.
328
+ */
329
+ getCall(n: number): SinonSpyCall<TArgs, TReturnValue>;
330
+ /**
331
+ * Returns an Array of all calls recorded by the spy.
332
+ */
333
+ getCalls(): Array<SinonSpyCall<TArgs, TReturnValue>>;
334
+ /**
335
+ * Resets the state of a spy.
336
+ */
337
+ resetHistory(): void;
338
+ /**
339
+ * Returns the passed format string with the following replacements performed:
340
+ * * %n - the name of the spy "spy" by default)
341
+ * * %c - the number of times the spy was called, in words ("once", "twice", etc.)
342
+ * * %C - a list of string representations of the calls to the spy, with each call prefixed by a newline and four spaces
343
+ * * %t - a comma-delimited list of this values the spy was called on
344
+ * * %n - the formatted value of the nth argument passed to printf
345
+ * * %* - a comma-delimited list of the (non-format string) arguments passed to printf
346
+ * * %D - a multi-line list of the arguments received by all calls to the spy
347
+ * @param format
348
+ * @param args
349
+ */
350
+ printf(format: string, ...args: any[]): string;
351
+ /**
352
+ * Replaces the spy with the original method. Only available if the spy replaced an existing method.
353
+ */
354
+ restore(): void;
355
+ }
356
+
357
+ interface SinonSpyStatic {
358
+ /**
359
+ * Creates an anonymous function that records arguments, this value, exceptions and return values for all calls.
360
+ */
361
+ (): SinonSpy;
362
+ /**
363
+ * Spies on the provided function
364
+ */
365
+ <F extends (...args: any[]) => any>(func: F): SinonSpy<Parameters<F>, ReturnType<F>>;
366
+ /**
367
+ * Spies on all the object’s methods.
368
+ */
369
+ <T>(obj: T): SinonSpiedInstance<T>;
370
+ /**
371
+ * Creates a spy for object.method and replaces the original method with the spy.
372
+ * An exception is thrown if the property is not already a function.
373
+ * The spy acts exactly like the original method in all cases.
374
+ * The original method can be restored by calling object.method.restore().
375
+ * The returned spy is the function object which replaced the original method. spy === object.method.
376
+ */
377
+ <T, K extends keyof T>(
378
+ obj: T,
379
+ method: K,
380
+ ): T[K] extends (...args: infer TArgs) => infer TReturnValue ? SinonSpy<TArgs, TReturnValue>
381
+ : SinonSpy;
382
+
383
+ <T, K extends keyof T>(obj: T, method: K, types: Array<"get" | "set">): PropertyDescriptor & {
384
+ get: SinonSpy<[], T[K]>;
385
+ set: SinonSpy<[T[K]], void>;
386
+ };
387
+ }
388
+
389
+ type SinonSpiedInstance<T> = {
390
+ [P in keyof T]: SinonSpiedMember<T[P]>;
391
+ };
392
+
393
+ type SinonSpiedMember<T> = T extends (...args: infer TArgs) => infer TReturnValue ? SinonSpy<TArgs, TReturnValue>
394
+ : T;
395
+
396
+ interface SinonStub<TArgs extends readonly any[] = any[], TReturnValue = any>
397
+ extends SinonSpy<TArgs, TReturnValue>
398
+ {
399
+ /**
400
+ * Resets the stub’s behaviour to the default behaviour
401
+ * You can reset behaviour of all stubs using sinon.resetBehavior()
402
+ */
403
+ resetBehavior(): void;
404
+ /**
405
+ * Resets both behaviour and history of the stub.
406
+ * This is equivalent to calling both stub.resetBehavior() and stub.resetHistory()
407
+ * Updated in sinon@2.0.0
408
+ * Since sinon@5.0.0
409
+ * As a convenience, you can apply stub.reset() to all stubs using sinon.reset()
410
+ */
411
+ reset(): void;
412
+
413
+ /**
414
+ * Makes the stub return the provided @param obj value.
415
+ * @param obj
416
+ */
417
+ returns(obj: TReturnValue): SinonStub<TArgs, TReturnValue>;
418
+ /**
419
+ * Causes the stub to return the argument at the provided @param index.
420
+ * stub.returnsArg(0); causes the stub to return the first argument.
421
+ * If the argument at the provided index is not available, prior to sinon@6.1.2, an undefined value will be returned;
422
+ * starting from sinon@6.1.2, a TypeError will be thrown.
423
+ * @param index
424
+ */
425
+ returnsArg(index: number): SinonStub<TArgs, TReturnValue>;
426
+ /**
427
+ * Causes the stub to return its this value.
428
+ * Useful for stubbing jQuery-style fluent APIs.
429
+ */
430
+ returnsThis(): SinonStub<TArgs, TReturnValue>;
431
+ /**
432
+ * Causes the stub to return a Promise which resolves to the provided value.
433
+ * When constructing the Promise, sinon uses the Promise.resolve method.
434
+ * You are responsible for providing a polyfill in environments which do not provide Promise.
435
+ * Since sinon@2.0.0
436
+ */
437
+ resolves(
438
+ value?: TReturnValue extends PromiseLike<infer TResolveValue> ? TResolveValue : any,
439
+ ): SinonStub<TArgs, TReturnValue>;
440
+ /**
441
+ * Causes the stub to return a Promise which resolves to the argument at the provided index.
442
+ * stub.resolvesArg(0); causes the stub to return a Promise which resolves to the first argument.
443
+ * If the argument at the provided index is not available, a TypeError will be thrown.
444
+ */
445
+ resolvesArg(index: number): SinonStub<TArgs, TReturnValue>;
446
+ /**
447
+ * Causes the stub to return a Promise which resolves to its this value.
448
+ */
449
+ resolvesThis(): SinonStub<TArgs, TReturnValue>;
450
+ /**
451
+ * Causes the stub to throw an exception (Error).
452
+ * @param type
453
+ */
454
+ throws(type?: string): SinonStub<TArgs, TReturnValue>;
455
+ /**
456
+ * Causes the stub to throw the provided exception object.
457
+ */
458
+ throws(obj: any): SinonStub<TArgs, TReturnValue>;
459
+ /**
460
+ * Causes the stub to throw the argument at the provided index.
461
+ * stub.throwsArg(0); causes the stub to throw the first argument as the exception.
462
+ * If the argument at the provided index is not available, a TypeError will be thrown.
463
+ * Since sinon@2.3.0
464
+ * @param index
465
+ */
466
+ throwsArg(index: number): SinonStub<TArgs, TReturnValue>;
467
+ throwsException(type?: string): SinonStub<TArgs, TReturnValue>;
468
+ throwsException(obj: any): SinonStub<TArgs, TReturnValue>;
469
+ /**
470
+ * Causes the stub to return a Promise which rejects with an exception (Error).
471
+ * When constructing the Promise, sinon uses the Promise.reject method.
472
+ * You are responsible for providing a polyfill in environments which do not provide Promise.
473
+ * Since sinon@2.0.0
474
+ */
475
+ rejects(): SinonStub<TArgs, TReturnValue>;
476
+ /**
477
+ * Causes the stub to return a Promise which rejects with an exception of the provided type.
478
+ * Since sinon@2.0.0
479
+ */
480
+ rejects(errorType: string): SinonStub<TArgs, TReturnValue>;
481
+ /**
482
+ * Causes the stub to return a Promise which rejects with the provided exception object.
483
+ * Since sinon@2.0.0
484
+ */
485
+ rejects(value: any): SinonStub<TArgs, TReturnValue>;
486
+ /**
487
+ * Causes the stub to call the argument at the provided index as a callback function.
488
+ * stub.callsArg(0); causes the stub to call the first argument as a callback.
489
+ * If the argument at the provided index is not available or is not a function, a TypeError will be thrown.
490
+ */
491
+ callsArg(index: number): SinonStub<TArgs, TReturnValue>;
492
+ /**
493
+ * Causes the original method wrapped into the stub to be called when none of the conditional stubs are matched.
494
+ */
495
+ callThrough(): SinonStub<TArgs, TReturnValue>;
496
+ /**
497
+ * Like stub.callsArg(index); but with an additional parameter to pass the this context.
498
+ * @param index
499
+ * @param context
500
+ */
501
+ callsArgOn(index: number, context: any): SinonStub<TArgs, TReturnValue>;
502
+ /**
503
+ * Like callsArg, but with arguments to pass to the callback.
504
+ * @param index
505
+ * @param args
506
+ */
507
+ callsArgWith(index: number, ...args: any[]): SinonStub<TArgs, TReturnValue>;
508
+ /**
509
+ * Like above but with an additional parameter to pass the this context.
510
+ * @param index
511
+ * @param context
512
+ * @param args
513
+ */
514
+ callsArgOnWith(index: number, context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
515
+ /**
516
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
517
+ * In Node environment the callback is deferred with process.nextTick.
518
+ * In a browser the callback is deferred with setTimeout(callback, 0).
519
+ * @param index
520
+ */
521
+ callsArgAsync(index: number): SinonStub<TArgs, TReturnValue>;
522
+ /**
523
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
524
+ * In Node environment the callback is deferred with process.nextTick.
525
+ * In a browser the callback is deferred with setTimeout(callback, 0).
526
+ * @param index
527
+ * @param context
528
+ */
529
+ callsArgOnAsync(index: number, context: any): SinonStub<TArgs, TReturnValue>;
530
+ /**
531
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
532
+ * In Node environment the callback is deferred with process.nextTick.
533
+ * In a browser the callback is deferred with setTimeout(callback, 0).
534
+ */
535
+ callsArgWithAsync(index: number, ...args: any[]): SinonStub<TArgs, TReturnValue>;
536
+ /**
537
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
538
+ * In Node environment the callback is deferred with process.nextTick.
539
+ * In a browser the callback is deferred with setTimeout(callback, 0).
540
+ */
541
+ callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
542
+ /**
543
+ * Makes the stub call the provided @param func when invoked.
544
+ * @param func
545
+ */
546
+ callsFake(func: (...args: TArgs) => TReturnValue): SinonStub<TArgs, TReturnValue>;
547
+ /**
548
+ * Replaces a new getter for this stub.
549
+ */
550
+ get(func: () => any): SinonStub<TArgs, TReturnValue>;
551
+ /**
552
+ * Defines a new setter for this stub.
553
+ * @param func
554
+ */
555
+ set(func: (v: any) => void): SinonStub<TArgs, TReturnValue>;
556
+ /**
557
+ * Defines the behavior of the stub on the @param n call. Useful for testing sequential interactions.
558
+ * There are methods onFirstCall, onSecondCall,onThirdCall to make stub definitions read more naturally.
559
+ * onCall can be combined with all of the behavior defining methods in this section. In particular, it can be used together with withArgs.
560
+ * @param n Zero-based index of the spy call.
561
+ */
562
+ onCall(n: number): SinonStub<TArgs, TReturnValue>;
563
+ /**
564
+ * Alias for stub.onCall(0);
565
+ */
566
+ onFirstCall(): SinonStub<TArgs, TReturnValue>;
567
+ /**
568
+ * Alias for stub.onCall(1);
569
+ */
570
+ onSecondCall(): SinonStub<TArgs, TReturnValue>;
571
+ /**
572
+ * Alias for stub.onCall(2);
573
+ */
574
+ onThirdCall(): SinonStub<TArgs, TReturnValue>;
575
+ /**
576
+ * Defines a new value for this stub.
577
+ * @param val
578
+ */
579
+ value(val: any): SinonStub<TArgs, TReturnValue>;
580
+ /**
581
+ * Set the displayName of the spy or stub.
582
+ * @param name
583
+ */
584
+ named(name: string): SinonStub<TArgs, TReturnValue>;
585
+ /**
586
+ * Similar to callsArg.
587
+ * Causes the stub to call the first callback it receives with the provided arguments (if any).
588
+ * If a method accepts more than one callback, you need to use callsArg to have the stub invoke other callbacks than the first one.
589
+ */
590
+ yields(...args: any[]): SinonStub<TArgs, TReturnValue>;
591
+ /**
592
+ * Like above but with an additional parameter to pass the this context.
593
+ */
594
+ yieldsOn(context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
595
+ yieldsRight(...args: any[]): SinonStub<TArgs, TReturnValue>;
596
+ /**
597
+ * Causes the spy to invoke a callback passed as a property of an object to the spy.
598
+ * Like yields, yieldsTo grabs the first matching argument, finds the callback and calls it with the (optional) arguments.
599
+ * @param property
600
+ * @param args
601
+ */
602
+ yieldsTo(property: string, ...args: any[]): SinonStub<TArgs, TReturnValue>;
603
+ /**
604
+ * Like above but with an additional parameter to pass the this context.
605
+ */
606
+ yieldsToOn(property: string, context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
607
+ /**
608
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
609
+ * In Node environment the callback is deferred with process.nextTick.
610
+ * In a browser the callback is deferred with setTimeout(callback, 0).
611
+ * @param args
612
+ */
613
+ yieldsAsync(...args: any[]): SinonStub<TArgs, TReturnValue>;
614
+ /**
615
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
616
+ * In Node environment the callback is deferred with process.nextTick.
617
+ * In a browser the callback is deferred with setTimeout(callback, 0).
618
+ * @param context
619
+ * @param args
620
+ */
621
+ yieldsOnAsync(context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
622
+ /**
623
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
624
+ * In Node environment the callback is deferred with process.nextTick.
625
+ * In a browser the callback is deferred with setTimeout(callback, 0).
626
+ * @param property
627
+ * @param args
628
+ */
629
+ yieldsToAsync(property: string, ...args: any[]): SinonStub<TArgs, TReturnValue>;
630
+ /**
631
+ * Same as their corresponding non-Async counterparts, but with callback being deferred at called after all instructions in the current call stack are processed.
632
+ * In Node environment the callback is deferred with process.nextTick.
633
+ * In a browser the callback is deferred with setTimeout(callback, 0).
634
+ * @param property
635
+ * @param context
636
+ * @param args
637
+ */
638
+ yieldsToOnAsync(property: string, context: any, ...args: any[]): SinonStub<TArgs, TReturnValue>;
639
+ /**
640
+ * Stubs the method only for the provided arguments.
641
+ * This is useful to be more expressive in your assertions, where you can access the spy with the same call.
642
+ * It is also useful to create a stub that can act differently in response to different arguments.
643
+ * @param args
644
+ */
645
+ withArgs(...args: MatchPartialArguments<TArgs>): SinonStub<TArgs, TReturnValue>;
646
+ }
647
+
648
+ interface SinonStubStatic {
649
+ /* tslint:disable:no-unnecessary-generics */
650
+
651
+ /**
652
+ * Creates an anonymous stub function
653
+ */
654
+ <TArgs extends readonly any[] = any[], R = any>(): SinonStub<TArgs, R>;
655
+
656
+ /* tslint:enable:no-unnecessary-generics */
657
+
658
+ /**
659
+ * Stubs all the object’s methods.
660
+ * Note that it’s usually better practice to stub individual methods, particularly on objects that you don’t understand or control all the methods for (e.g. library dependencies).
661
+ * Stubbing individual methods tests intent more precisely and is less susceptible to unexpected behavior as the object’s code evolves.
662
+ * If you want to create a stub object of MyConstructor, but don’t want the constructor to be invoked, use this utility function.
663
+ */
664
+ <T>(obj: T): SinonStubbedInstance<T>;
665
+ /**
666
+ * Replaces obj.method with a stub function.
667
+ * An exception is thrown if the property is not already a function.
668
+ * The original function can be restored by calling object.method.restore(); (or stub.restore();).
669
+ */
670
+ <T, K extends keyof T>(obj: T, method: K): SinonStubbedFunction<T[K]>;
671
+ }
672
+
673
+ interface SinonExpectation extends SinonStub {
674
+ /**
675
+ * Specify the minimum amount of calls expected.
676
+ */
677
+ atLeast(n: number): SinonExpectation;
678
+ /**
679
+ * Specify the maximum amount of calls expected.
680
+ * @param n
681
+ */
682
+ atMost(n: number): SinonExpectation;
683
+ /**
684
+ * Expect the method to never be called.
685
+ */
686
+ never(): SinonExpectation;
687
+ /**
688
+ * Expect the method to be called exactly once.
689
+ */
690
+ once(): SinonExpectation;
691
+ /**
692
+ * Expect the method to be called exactly twice.
693
+ */
694
+ twice(): SinonExpectation;
695
+ /**
696
+ * Expect the method to be called exactly thrice.
697
+ */
698
+ thrice(): SinonExpectation;
699
+ /**
700
+ * Expect the method to be called exactly @param n times.
701
+ */
702
+ exactly(n: number): SinonExpectation;
703
+ /**
704
+ * Expect the method to be called with the provided arguments and possibly others.
705
+ * An expectation instance only holds onto a single set of arguments specified with withArgs.
706
+ * Subsequent calls will overwrite the previously-specified set of arguments (even if they are different),
707
+ * so it is generally not intended that this method be invoked more than once per test case.
708
+ * @param args
709
+ */
710
+ withArgs(...args: any[]): SinonExpectation;
711
+ /**
712
+ * Expect the method to be called with the provided arguments and no others.
713
+ * An expectation instance only holds onto a single set of arguments specified with withExactArgs.
714
+ * Subsequent calls will overwrite the previously-specified set of arguments (even if they are different),
715
+ * so it is generally not intended that this method be invoked more than once per test case.
716
+ * @param args
717
+ */
718
+ withExactArgs(...args: any[]): SinonExpectation;
719
+ on(obj: any): SinonExpectation;
720
+ /**
721
+ * Verifies all expectations on the mock.
722
+ * If any expectation is not satisfied, an exception is thrown.
723
+ * Also restores the mocked methods.
724
+ */
725
+ verify(): SinonExpectation;
726
+ /**
727
+ * Restores all mocked methods.
728
+ */
729
+ restore(): void;
730
+ }
731
+
732
+ interface SinonExpectationStatic {
733
+ /**
734
+ * Creates an expectation without a mock object, basically an anonymous mock function.
735
+ * Method name is optional and is used in exception messages to make them more readable.
736
+ * @param methodName
737
+ */
738
+ create(methodName?: string): SinonExpectation;
739
+ }
740
+
741
+ interface SinonMock {
742
+ /**
743
+ * Overrides obj.method with a mock function and returns it.
744
+ */
745
+ expects(method: string): SinonExpectation;
746
+ /**
747
+ * Restores all mocked methods.
748
+ */
749
+ restore(): void;
750
+ /**
751
+ * Verifies all expectations on the mock.
752
+ * If any expectation is not satisfied, an exception is thrown.
753
+ * Also restores the mocked methods.
754
+ */
755
+ verify(): void;
756
+ }
757
+
758
+ interface SinonMockStatic {
759
+ (name?: string): SinonExpectation;
760
+ /**
761
+ * Creates a mock for the provided object.
762
+ * Does not change the object, but returns a mock object to set expectations on the object’s methods.
763
+ */
764
+ (obj: any): SinonMock;
765
+ }
766
+
767
+ type SinonFakeTimers = FakeTimers.Clock & {
768
+ /**
769
+ * Restores the original clock
770
+ * Identical to uninstall()
771
+ */
772
+ restore(): void;
773
+ };
774
+
775
+ interface SinonFakeUploadProgress {
776
+ eventListeners: {
777
+ progress: any[];
778
+ load: any[];
779
+ abort: any[];
780
+ error: any[];
781
+ };
782
+
783
+ addEventListener(event: string, listener: (e: Event) => any): void;
784
+ removeEventListener(event: string, listener: (e: Event) => any): void;
785
+ dispatchEvent(event: Event): void;
786
+ }
787
+
788
+ interface SinonExposeOptions {
789
+ prefix: string;
790
+ includeFail: boolean;
791
+ }
792
+
793
+ interface SinonAssert {
794
+ // Properties
795
+ /**
796
+ * Every assertion fails by calling this method.
797
+ * If your testing framework of choice looks for assertion errors by checking for a specific exception, you can override the `fail` method to do the right thing.
798
+ */
799
+ fail(message?: string): void; // Overridable
800
+ /**
801
+ * Called every time assertion passes.
802
+ * Default implementation does nothing.
803
+ */
804
+ pass(assertion: any): void; // Overridable
805
+
806
+ // Methods
807
+
808
+ /**
809
+ * Passes if spy was never called
810
+ * @param spy
811
+ */
812
+ notCalled(spy: SinonSpy<any>): void;
813
+ /**
814
+ * Passes if spy was called at least once.
815
+ */
816
+ called(spy: SinonSpy<any>): void;
817
+ /**
818
+ * Passes if spy was called once and only once.
819
+ */
820
+ calledOnce(spy: SinonSpy<any>): void;
821
+ /**
822
+ * Passes if spy was called exactly twice.
823
+ */
824
+ calledTwice(spy: SinonSpy<any>): void;
825
+ /**
826
+ * Passes if spy was called exactly three times.
827
+ */
828
+ calledThrice(spy: SinonSpy<any>): void;
829
+ /**
830
+ * Passes if spy was called exactly num times.
831
+ */
832
+ callCount(spy: SinonSpy<any>, count: number): void;
833
+ /**
834
+ * Passes if provided spies were called in the specified order.
835
+ * @param spies
836
+ */
837
+ callOrder(...spies: Array<SinonSpy<any>>): void;
838
+ /**
839
+ * Passes if spy was ever called with obj as its this value.
840
+ * It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);.
841
+ */
842
+ calledOn(spyOrSpyCall: SinonSpy<any> | SinonSpyCall<any>, obj: any): void;
843
+ /**
844
+ * Passes if spy was always called with obj as its this value.
845
+ */
846
+ alwaysCalledOn(spy: SinonSpy<any>, obj: any): void;
847
+
848
+ /**
849
+ * Passes if spy was called with the provided arguments.
850
+ * It’s possible to assert on a dedicated spy call: sinon.assert.calledWith(spy.firstCall, arg1, arg2, ...);.
851
+ * @param spyOrSpyCall
852
+ * @param args
853
+ */
854
+ calledWith<TArgs extends any[]>(
855
+ spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
856
+ ...args: MatchPartialArguments<TArgs>
857
+ ): void;
858
+ /**
859
+ * Passes if spy was always called with the provided arguments.
860
+ * @param spy
861
+ * @param args
862
+ */
863
+ alwaysCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
864
+ /**
865
+ * Passes if spy was never called with the provided arguments.
866
+ * @param spy
867
+ * @param args
868
+ */
869
+ neverCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
870
+ /**
871
+ * Passes if spy was called with the provided arguments and no others.
872
+ * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithExactly(spy.getCall(1), arg1, arg2, ...);.
873
+ * @param spyOrSpyCall
874
+ * @param args
875
+ */
876
+ calledWithExactly<TArgs extends any[]>(
877
+ spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
878
+ ...args: MatchExactArguments<TArgs>
879
+ ): void;
880
+ /**
881
+ * Passes if spy was called at exactly once with the provided arguments and no others.
882
+ * @param spyOrSpyCall
883
+ * @param args
884
+ */
885
+ calledOnceWithExactly<TArgs extends any[]>(
886
+ spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
887
+ ...args: MatchExactArguments<TArgs>
888
+ ): void;
889
+ /**
890
+ * Passes if spy was always called with the provided arguments and no others.
891
+ */
892
+ alwaysCalledWithExactly<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchExactArguments<TArgs>): void;
893
+ /**
894
+ * Passes if spy was called with matching arguments.
895
+ * This behaves the same way as sinon.assert.calledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
896
+ * It's possible to assert on a dedicated spy call: sinon.assert.calledWithMatch(spy.secondCall, arg1, arg2, ...);.
897
+ */
898
+ calledWithMatch<TArgs extends any[]>(
899
+ spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
900
+ ...args: MatchPartialArguments<TArgs>
901
+ ): void;
902
+ /**
903
+ * Passes if spy was called once with matching arguments.
904
+ * This behaves the same way as calling both sinon.assert.calledOnce(spy) and
905
+ * sinon.assert.calledWithMatch(spy, ...).
906
+ */
907
+ calledOnceWithMatch<TArgs extends any[]>(
908
+ spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
909
+ ...args: MatchPartialArguments<TArgs>
910
+ ): void;
911
+ /**
912
+ * Passes if spy was always called with matching arguments.
913
+ * This behaves the same way as sinon.assert.alwaysCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
914
+ */
915
+ alwaysCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
916
+ /**
917
+ * Passes if spy was never called with matching arguments.
918
+ * This behaves the same way as sinon.assert.neverCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
919
+ * @param spy
920
+ * @param args
921
+ */
922
+ neverCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
923
+ /**
924
+ * Passes if spy was called with the new operator.
925
+ * It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);.
926
+ * @param spyOrSpyCall
927
+ */
928
+ calledWithNew(spyOrSpyCall: SinonSpy<any> | SinonSpyCall<any>): void;
929
+ /**
930
+ * Passes if spy threw any exception.
931
+ */
932
+ threw(spyOrSpyCall: SinonSpy<any> | SinonSpyCall<any>): void;
933
+ /**
934
+ * Passes if spy threw the given exception.
935
+ * The exception is an actual object.
936
+ * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);.
937
+ */
938
+ threw(spyOrSpyCall: SinonSpy<any> | SinonSpyCall<any>, exception: string): void;
939
+ /**
940
+ * Passes if spy threw the given exception.
941
+ * The exception is a String denoting its type.
942
+ * It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);.
943
+ */
944
+ threw(spyOrSpyCall: SinonSpy<any> | SinonSpyCall<any>, exception: any): void;
945
+
946
+ /**
947
+ * Like threw, only required for all calls to the spy.
948
+ */
949
+ alwaysThrew(spy: SinonSpy<any>): void;
950
+ /**
951
+ * Like threw, only required for all calls to the spy.
952
+ */
953
+ alwaysThrew(spy: SinonSpy<any>, exception: string): void;
954
+ /**
955
+ * Like threw, only required for all calls to the spy.
956
+ */
957
+ alwaysThrew(spy: SinonSpy<any>, exception: any): void;
958
+
959
+ /**
960
+ * Uses sinon.match to test if the arguments can be considered a match.
961
+ */
962
+ match(actual: any, expected: any): void;
963
+ /**
964
+ * Exposes assertions into another object, to better integrate with the test framework.
965
+ * For instance, JsTestDriver uses global assertions, and to make Sinon.JS assertions appear alongside them, you can do.
966
+ * @example sinon.assert.expose(this);
967
+ * This will give you assertCalled(spy),assertCallOrder(spy1, spy2, ...) and so on.
968
+ * The method accepts an optional options object with two options.
969
+ */
970
+ expose(obj: any, options?: Partial<SinonExposeOptions>): void;
971
+ }
972
+
973
+ interface SinonMatcher {
974
+ /**
975
+ * All matchers implement and and or. This allows to logically combine mutliple matchers.
976
+ * The result is a new matchers that requires both (and) or one of the matchers (or) to return true.
977
+ * @example var stringOrNumber = sinon.match.string.or(sinon.match.number);
978
+ * var bookWithPages = sinon.match.instanceOf(Book).and(sinon.match.has("pages"));
979
+ */
980
+ and(expr: SinonMatcher): SinonMatcher;
981
+ /**
982
+ * All matchers implement and and or. This allows to logically combine mutliple matchers.
983
+ * The result is a new matchers that requires both (and) or one of the matchers (or) to return true.
984
+ * @example var stringOrNumber = sinon.match.string.or(sinon.match.number);
985
+ * var bookWithPages = sinon.match.instanceOf(Book).and(sinon.match.has("pages"));
986
+ */
987
+ or(expr: SinonMatcher): SinonMatcher;
988
+ test(val: any): boolean;
989
+ }
990
+
991
+ interface SinonArrayMatcher extends SinonMatcher {
992
+ /**
993
+ * Requires an Array to be deep equal another one.
994
+ */
995
+ deepEquals(expected: any[]): SinonMatcher;
996
+ /**
997
+ * Requires an Array to start with the same values as another one.
998
+ */
999
+ startsWith(expected: any[]): SinonMatcher;
1000
+ /**
1001
+ * Requires an Array to end with the same values as another one.
1002
+ */
1003
+ endsWith(expected: any[]): SinonMatcher;
1004
+ /**
1005
+ * Requires an Array to contain each one of the values the given array has.
1006
+ */
1007
+ contains(expected: any[]): SinonMatcher;
1008
+ }
1009
+
1010
+ interface SimplifiedSet {
1011
+ has(el: any): boolean;
1012
+ }
1013
+
1014
+ interface SimplifiedMap extends SimplifiedSet {
1015
+ get(key: any): any;
1016
+ }
1017
+
1018
+ interface SinonMapMatcher extends SinonMatcher {
1019
+ /**
1020
+ * Requires a Map to be deep equal another one.
1021
+ */
1022
+ deepEquals(expected: SimplifiedMap): SinonMatcher;
1023
+ /**
1024
+ * Requires a Map to contain each one of the items the given map has.
1025
+ */
1026
+ contains(expected: SimplifiedMap): SinonMatcher;
1027
+ }
1028
+
1029
+ interface SinonSetMatcher extends SinonMatcher {
1030
+ /**
1031
+ * Requires a Set to be deep equal another one.
1032
+ */
1033
+ deepEquals(expected: SimplifiedSet): SinonMatcher;
1034
+ /**
1035
+ * Requires a Set to contain each one of the items the given set has.
1036
+ */
1037
+ contains(expected: SimplifiedSet): SinonMatcher;
1038
+ }
1039
+
1040
+ interface SinonMatch {
1041
+ /**
1042
+ * Requires the value to be == to the given number.
1043
+ */
1044
+ (value: number): SinonMatcher;
1045
+ /**
1046
+ * Requires the value to be a string and have the expectation as a substring.
1047
+ */
1048
+ (value: string): SinonMatcher;
1049
+ /**
1050
+ * Requires the value to be a string and match the given regular expression.
1051
+ */
1052
+ (expr: RegExp): SinonMatcher;
1053
+ /**
1054
+ * See custom matchers.
1055
+ */
1056
+ (callback: (value: any) => boolean, message?: string): SinonMatcher;
1057
+ /**
1058
+ * Requires the value to be not null or undefined and have at least the same properties as expectation.
1059
+ * This supports nested matchers.
1060
+ */
1061
+ (obj: object): SinonMatcher;
1062
+ /**
1063
+ * Matches anything.
1064
+ */
1065
+ any: SinonMatcher;
1066
+ /**
1067
+ * Requires the value to be defined.
1068
+ */
1069
+ defined: SinonMatcher;
1070
+ /**
1071
+ * Requires the value to be truthy.
1072
+ */
1073
+ truthy: SinonMatcher;
1074
+ /**
1075
+ * Requires the value to be falsy.
1076
+ */
1077
+ falsy: SinonMatcher;
1078
+ /**
1079
+ * Requires the value to be a Boolean
1080
+ */
1081
+ bool: SinonMatcher;
1082
+ /**
1083
+ * Requires the value to be a Number.
1084
+ */
1085
+ number: SinonMatcher;
1086
+ /**
1087
+ * Requires the value to be a String.
1088
+ */
1089
+ string: SinonMatcher;
1090
+ /**
1091
+ * Requires the value to be an Object.
1092
+ */
1093
+ object: SinonMatcher;
1094
+ /**
1095
+ * Requires the value to be a Function.
1096
+ */
1097
+ func: SinonMatcher;
1098
+ /**
1099
+ * Requires the value to be a Map.
1100
+ */
1101
+ map: SinonMapMatcher;
1102
+ /**
1103
+ * Requires the value to be a Set.
1104
+ */
1105
+ set: SinonSetMatcher;
1106
+ /**
1107
+ * Requires the value to be an Array.
1108
+ */
1109
+ array: SinonArrayMatcher;
1110
+ /**
1111
+ * Requires the value to be a regular expression.
1112
+ */
1113
+ regexp: SinonMatcher;
1114
+ /**
1115
+ * Requires the value to be a Date object.
1116
+ */
1117
+ date: SinonMatcher;
1118
+ /**
1119
+ * Requires the value to be a Symbol.
1120
+ */
1121
+ symbol: SinonMatcher;
1122
+ /**
1123
+ * Requires the value to be in the specified array.
1124
+ */
1125
+ in(allowed: any[]): SinonMatcher;
1126
+ /**
1127
+ * Requires the value to strictly equal ref.
1128
+ */
1129
+ same(obj: any): SinonMatcher;
1130
+ /**
1131
+ * Requires the value to be of the given type, where type can be one of "undefined", "null", "boolean", "number", "string", "object", "function", "array", "regexp", "date" or "symbol".
1132
+ */
1133
+ typeOf(type: string): SinonMatcher;
1134
+ /**
1135
+ * Requires the value to be an instance of the given type.
1136
+ */
1137
+ instanceOf(type: any): SinonMatcher;
1138
+ /**
1139
+ * Requires the value to define the given property.
1140
+ * The property might be inherited via the prototype chain.
1141
+ * If the optional expectation is given, the value of the property is deeply compared with the expectation.
1142
+ * The expectation can be another matcher.
1143
+ * @param property
1144
+ * @param expect
1145
+ */
1146
+ has(property: string, expect?: any): SinonMatcher;
1147
+ /**
1148
+ * Same as sinon.match.has but the property must be defined by the value itself. Inherited properties are ignored.
1149
+ * @param property
1150
+ * @param expect
1151
+ */
1152
+ hasOwn(property: string, expect?: any): SinonMatcher;
1153
+ /**
1154
+ * Requires the value to define the given propertyPath. Dot (prop.prop) and bracket (prop[0]) notations are supported as in Lodash.get.
1155
+ * The propertyPath might be inherited via the prototype chain.
1156
+ * If the optional expectation is given, the value at the propertyPath is deeply compared with the expectation.
1157
+ * The expectation can be another matcher.
1158
+ */
1159
+ hasNested(path: string, expect?: any): SinonMatcher;
1160
+ /**
1161
+ * Requires every element of an Array, Set or Map, or alternatively every value of an Object to match the given matcher.
1162
+ */
1163
+ every(matcher: SinonMatcher): SinonMatcher;
1164
+ /**
1165
+ * Requires any element of an Array, Set or Map, or alternatively any value of an Object to match the given matcher.
1166
+ */
1167
+ some(matcher: SinonMatcher): SinonMatcher;
1168
+ }
1169
+
1170
+ interface SinonSandboxConfig {
1171
+ /**
1172
+ * The sandbox’s methods can be injected into another object for convenience.
1173
+ * The injectInto configuration option can name an object to add properties to.
1174
+ */
1175
+ injectInto: object | null;
1176
+ /**
1177
+ * Which properties to inject into the facade object. By default empty!
1178
+ */
1179
+ properties: string[];
1180
+ /**
1181
+ * If set to true, the sandbox will have a clock property.
1182
+ * You can optionally pass in a configuration object that follows the specification for fake timers, such as { toFake: ["setTimeout", "setInterval"] }.
1183
+ */
1184
+ useFakeTimers: boolean | Partial<FakeTimers.FakeTimerInstallOpts>;
1185
+ /**
1186
+ * The assert options can help limit the amount of output produced by assert.fail
1187
+ */
1188
+ assertOptions: {
1189
+ shouldLimitAssertionLogs?: boolean;
1190
+ assertionLogLimit?: number;
1191
+ };
1192
+ }
1193
+
1194
+ /**
1195
+ * Stubbed type of an object with members replaced by stubs.
1196
+ *
1197
+ * @template TType Type being stubbed.
1198
+ */
1199
+ type StubbableType<TType> = Function & { prototype: TType };
1200
+
1201
+ /**
1202
+ * An instance of a stubbed object type with functions replaced by stubs.
1203
+ *
1204
+ * @template TType Object type being stubbed.
1205
+ */
1206
+ type SinonStubbedInstance<TType> =
1207
+ & TType
1208
+ & {
1209
+ [P in keyof TType]: SinonStubbedMember<TType[P]>;
1210
+ };
1211
+
1212
+ /**
1213
+ * Replaces a type with a Sinon stub if it's a function.
1214
+ */
1215
+ type SinonStubbedMember<T> = T extends (...args: infer TArgs) => infer TReturnValue ? SinonStub<TArgs, TReturnValue>
1216
+ : T;
1217
+
1218
+ /**
1219
+ * Replaces a function type with a Sinon stub.
1220
+ */
1221
+ type SinonStubbedFunction<T> = T extends (...args: infer TArgs) => infer TReturnValue
1222
+ ? SinonStub<TArgs, TReturnValue>
1223
+ : SinonStub;
1224
+
1225
+ interface SinonFake {
1226
+ /**
1227
+ * Creates a basic fake, with no behavior
1228
+ */
1229
+ <TArgs extends readonly any[] = any[], TReturnValue = any>(): SinonSpy<TArgs, TReturnValue>;
1230
+ /**
1231
+ * Wraps an existing Function to record all interactions, while leaving it up to the func to provide the behavior.
1232
+ * This is useful when complex behavior not covered by the sinon.fake.* methods is required or when wrapping an existing function or method.
1233
+ */
1234
+ <TArgs extends readonly any[] = any[], TReturnValue = any>(fn: (...args: TArgs) => TReturnValue): SinonSpy<
1235
+ TArgs,
1236
+ TReturnValue
1237
+ >;
1238
+ /**
1239
+ * Creates a fake that returns the val argument
1240
+ * @param val Returned value
1241
+ */
1242
+ returns<TArgs extends readonly any[] = any[], TReturnValue = any>(
1243
+ val: TReturnValue,
1244
+ ): SinonSpy<TArgs, TReturnValue>;
1245
+ /**
1246
+ * Creates a fake that throws an Error with the provided value as the message property.
1247
+ * If an Error is passed as the val argument, then that will be the thrown value. If any other value is passed, then that will be used for the message property of the thrown Error.
1248
+ * @param val Returned value or throw value if an Error
1249
+ */
1250
+ throws<TArgs extends readonly any[] = any[], TReturnValue = any>(
1251
+ val: Error | string,
1252
+ ): SinonSpy<TArgs, TReturnValue>;
1253
+ /**
1254
+ * Creates a fake that returns a resolved Promise for the passed value.
1255
+ * @param val Resolved promise
1256
+ */
1257
+ resolves<TArgs extends readonly any[] = any[], TReturnValue = any>(
1258
+ val: TReturnValue extends PromiseLike<infer TResolveValue> ? TResolveValue : any,
1259
+ ): SinonSpy<TArgs, TReturnValue>;
1260
+ /**
1261
+ * Creates a fake that returns a rejected Promise for the passed value.
1262
+ * If an Error is passed as the value argument, then that will be the value of the promise.
1263
+ * If any other value is passed, then that will be used for the message property of the Error returned by the promise.
1264
+ * @param val Rejected promise
1265
+ */
1266
+ rejects<TArgs extends readonly any[] = any[], TReturnValue = any>(val: any): SinonSpy<TArgs, TReturnValue>;
1267
+ /**
1268
+ * fake expects the last argument to be a callback and will invoke it with the given arguments.
1269
+ */
1270
+ yields<TArgs extends readonly any[] = any[], TReturnValue = any>(...args: any[]): SinonSpy<TArgs, TReturnValue>;
1271
+ /**
1272
+ * fake expects the last argument to be a callback and will invoke it asynchronously with the given arguments.
1273
+ */
1274
+ yieldsAsync<TArgs extends readonly any[] = any[], TReturnValue = any>(
1275
+ ...args: any[]
1276
+ ): SinonSpy<TArgs, TReturnValue>;
1277
+ }
1278
+
1279
+ interface SandboxReplace {
1280
+ /**
1281
+ * Replaces property on object with replacement argument.
1282
+ * Attempts to replace an already replaced value cause an exception.
1283
+ * replacement can be any value, including spies, stubs and fakes.
1284
+ * This method only works on non-accessor properties, for replacing accessors,
1285
+ * use sandbox.replaceGetter() and sandbox.replaceSetter().
1286
+ */
1287
+ <T, TKey extends keyof T, R extends T[TKey] = T[TKey]>(obj: T, prop: TKey, replacement: R): R;
1288
+
1289
+ /**
1290
+ * Assigns a value to a property on object with replacement argument.
1291
+ * replacement can be any value, including spies, stubs and fakes.
1292
+ * This method only works on accessor properties.
1293
+ */
1294
+ usingAccessor<T, TKey extends keyof T, R extends T[TKey] = T[TKey]>(obj: T, prop: TKey, replacement: R): R;
1295
+ }
1296
+
1297
+ interface SinonSandbox {
1298
+ /**
1299
+ * A convenience reference for sinon.assert
1300
+ * Since sinon@2.0.0
1301
+ */
1302
+ assert: SinonAssert;
1303
+ clock: SinonFakeTimers;
1304
+ match: SinonMatch;
1305
+ /**
1306
+ * Works exactly like sinon.spy
1307
+ */
1308
+ spy: SinonSpyStatic;
1309
+ /**
1310
+ * Works exactly like sinon.stub.
1311
+ */
1312
+ stub: SinonStubStatic;
1313
+ /**
1314
+ * Works exactly like sinon.mock
1315
+ */
1316
+ mock: SinonMockStatic;
1317
+
1318
+ fake: SinonFake;
1319
+
1320
+ /**
1321
+ * * No param : Causes Sinon to replace the global setTimeout, clearTimeout, setInterval, clearInterval, setImmediate, clearImmediate, process.hrtime, performance.now(when available)
1322
+ * and Date with a custom implementation which is bound to the returned clock object.
1323
+ * Starts the clock at the UNIX epoch (timestamp of 0).
1324
+ * * Now : As above, but rather than starting the clock with a timestamp of 0, start at the provided timestamp now.
1325
+ * Since sinon@2.0.0
1326
+ * You can also pass in a Date object, and its getTime() will be used for the starting timestamp.
1327
+ * * Config : As above, but allows further configuration options, some of which are:
1328
+ * * config.now - Number/Date - installs 'fake-timers' with the specified unix epoch (default: 0)
1329
+ * * config.toFake - String[ ] - an array with explicit function names to fake. By default `fake-timers` will automatically fake _all_ methods (changed in v19).
1330
+ * * config.shouldAdvanceTime - Boolean - tells `fake-timers` to increment mocked time automatically based on the real system time shift (default: false). When used in conjunction with `config.toFake`, it will only work if `'setInterval'` is included in `config.toFake`.
1331
+ * * Important note: when faking `nextTick`, normal calls to `process.nextTick()` will not execute automatically as they would during normal event-loop phases. You would have to call either `clock.next()`, `clock.tick()`, `clock.runAll()` or `clock.runToLast()` manually (see example below). You can easily work around this using the `config.toFake` option. Please refer to the [`fake-timers`](https://github.com/sinonjs/fake-timers) documentation for more information.
1332
+ * @param config
1333
+ */
1334
+ useFakeTimers(config?: number | Date | Partial<FakeTimers.FakeTimerInstallOpts>): SinonFakeTimers;
1335
+ /**
1336
+ * Restores all fakes created through sandbox.
1337
+ */
1338
+ restore(): void;
1339
+ /**
1340
+ * Resets the internal state of all fakes created through sandbox.
1341
+ */
1342
+ reset(): void;
1343
+ /**
1344
+ * Resets the history of all stubs created through the sandbox.
1345
+ * Since sinon@2.0.0
1346
+ */
1347
+ resetHistory(): void;
1348
+ /**
1349
+ * Resets the behaviour of all stubs created through the sandbox.
1350
+ * Since sinon@2.0.0
1351
+ */
1352
+ resetBehavior(): void;
1353
+ /**
1354
+ * Verifies all mocks created through the sandbox.
1355
+ */
1356
+ verify(): void;
1357
+ /**
1358
+ * Verifies all mocks and restores all fakes created through the sandbox.
1359
+ */
1360
+ verifyAndRestore(): void;
1361
+
1362
+ replace: SandboxReplace;
1363
+
1364
+ /**
1365
+ * Replaces getter for property on object with replacement argument. Attempts to replace an already replaced getter cause an exception.
1366
+ * replacement must be a Function, and can be instances of spies, stubs and fakes.
1367
+ * @param obj
1368
+ * @param prop
1369
+ * @param replacement
1370
+ */
1371
+ replaceGetter<T, TKey extends keyof T>(obj: T, prop: TKey, replacement: () => T[TKey]): () => T[TKey];
1372
+
1373
+ /**
1374
+ * Replaces setter for property on object with replacement argument. Attempts to replace an already replaced setter cause an exception.
1375
+ * replacement must be a Function, and can be instances of spies, stubs and fakes.
1376
+ * @param obj
1377
+ * @param prop
1378
+ * @param replacement
1379
+ */
1380
+ replaceSetter<T, TKey extends keyof T>(
1381
+ obj: T,
1382
+ prop: TKey,
1383
+ replacement: (val: T[TKey]) => void,
1384
+ ): (val: T[TKey]) => void;
1385
+
1386
+ /**
1387
+ * Creates a new object with the given functions as the prototype and stubs all implemented functions.
1388
+ *
1389
+ * @template TType Type being stubbed.
1390
+ * @param constructor Object or class to stub.
1391
+ * @param overrides An optional map overriding created stubs
1392
+ * @returns A stubbed version of the constructor.
1393
+ * @remarks The given constructor function is not invoked. See also the stub API.
1394
+ */
1395
+ createStubInstance<TType>(
1396
+ constructor: StubbableType<TType>,
1397
+ overrides?: {
1398
+ [K in keyof TType]?:
1399
+ | SinonStubbedMember<TType[K]>
1400
+ | (TType[K] extends (...args: any[]) => infer R ? R : TType[K]);
1401
+ },
1402
+ ): SinonStubbedInstance<TType>;
1403
+
1404
+ /**
1405
+ * Defines a property on the given object which will be torn down when
1406
+ * the sandbox is restored
1407
+ */
1408
+ define(
1409
+ obj: object,
1410
+ key: PropertyKey,
1411
+ value: unknown,
1412
+ ): void;
1413
+ }
1414
+
1415
+ type SinonPromise<T> = Promise<T> & {
1416
+ status: "pending" | "resolved" | "rejected";
1417
+ resolve(val: unknown): Promise<T>;
1418
+ reject(reason: unknown): Promise<void>;
1419
+ resolvedValue?: T;
1420
+ rejectedValue?: unknown;
1421
+ };
1422
+
1423
+ interface SinonApi {
1424
+ expectation: SinonExpectationStatic;
1425
+
1426
+ clock: {
1427
+ create(now: number | Date): FakeTimers.Clock;
1428
+ };
1429
+
1430
+ /**
1431
+ * Creates a new sandbox object with spies, stubs, and mocks.
1432
+ * @param config
1433
+ */
1434
+ createSandbox(config?: Partial<SinonSandboxConfig>): SinonSandbox;
1435
+ defaultConfig: Partial<SinonSandboxConfig>;
1436
+
1437
+ /**
1438
+ * Add a custom behavior.
1439
+ * The name will be available as a function on stubs, and the chaining mechanism
1440
+ * will be set up for you (e.g. no need to return anything from your function,
1441
+ * its return value will be ignored). The fn will be passed the fake instance
1442
+ * as its first argument, and then the user's arguments.
1443
+ */
1444
+ addBehavior: (name: string, fn: (fake: SinonStub, ...userArgs: any[]) => void) => void;
1445
+
1446
+ /**
1447
+ * Replace the default formatter used when formatting ECMAScript object
1448
+ * An example converts a basic object, such as {id: 42 }, to a string
1449
+ * on a format of your choosing, such as "{ id: 42 }"
1450
+ */
1451
+ setFormatter: (customFormatter: (...args: any[]) => string) => void;
1452
+
1453
+ promise<T = unknown>(
1454
+ executor?: (resolve: (value: T) => void, reject: (reason?: unknown) => void) => void,
1455
+ ): SinonPromise<T>;
1456
+ }
1457
+
1458
+ type SinonStatic = SinonSandbox & SinonApi;
1459
+ } const Sinon: Sinon.SinonStatic;
1460
+
1461
+ export = Sinon;
1462
+ export as namespace sinon;
1463
+
1464
+ }