@detent/sdk 0.0.0 → 0.1.1

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 (162) hide show
  1. package/README.md +4 -8
  2. package/_speakeasy/.github/action-inputs-config.json +53 -0
  3. package/_speakeasy/.github/action-security-config.json +88 -0
  4. package/dist/commonjs/lib/config.d.ts +3 -3
  5. package/dist/commonjs/lib/config.js +3 -3
  6. package/dist/esm/lib/config.d.ts +3 -3
  7. package/dist/esm/lib/config.js +3 -3
  8. package/examples/package-lock.json +1 -1
  9. package/jsr.json +1 -1
  10. package/package.json +5 -1
  11. package/src/lib/config.ts +3 -3
  12. package/.speakeasy/temp/downloaded_DebOqZlrza.json +0 -1
  13. package/.speakeasy/temp/downloaded_YLnaAbCoUV.json +0 -1
  14. package/examples/node_modules/.package-lock.json +0 -174
  15. package/examples/node_modules/@esbuild/darwin-arm64/package.json +0 -20
  16. package/examples/node_modules/@types/node/assert/strict.d.ts +0 -8
  17. package/examples/node_modules/@types/node/assert.d.ts +0 -1062
  18. package/examples/node_modules/@types/node/async_hooks.d.ts +0 -605
  19. package/examples/node_modules/@types/node/buffer.buffer.d.ts +0 -471
  20. package/examples/node_modules/@types/node/buffer.d.ts +0 -1936
  21. package/examples/node_modules/@types/node/child_process.d.ts +0 -1475
  22. package/examples/node_modules/@types/node/cluster.d.ts +0 -577
  23. package/examples/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  24. package/examples/node_modules/@types/node/compatibility/index.d.ts +0 -9
  25. package/examples/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  26. package/examples/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  27. package/examples/node_modules/@types/node/console.d.ts +0 -452
  28. package/examples/node_modules/@types/node/constants.d.ts +0 -21
  29. package/examples/node_modules/@types/node/crypto.d.ts +0 -4590
  30. package/examples/node_modules/@types/node/dgram.d.ts +0 -597
  31. package/examples/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  32. package/examples/node_modules/@types/node/dns/promises.d.ts +0 -479
  33. package/examples/node_modules/@types/node/dns.d.ts +0 -871
  34. package/examples/node_modules/@types/node/domain.d.ts +0 -170
  35. package/examples/node_modules/@types/node/events.d.ts +0 -977
  36. package/examples/node_modules/@types/node/fs/promises.d.ts +0 -1270
  37. package/examples/node_modules/@types/node/fs.d.ts +0 -4375
  38. package/examples/node_modules/@types/node/globals.d.ts +0 -172
  39. package/examples/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  40. package/examples/node_modules/@types/node/http.d.ts +0 -2049
  41. package/examples/node_modules/@types/node/http2.d.ts +0 -2631
  42. package/examples/node_modules/@types/node/https.d.ts +0 -578
  43. package/examples/node_modules/@types/node/index.d.ts +0 -93
  44. package/examples/node_modules/@types/node/inspector.generated.d.ts +0 -3966
  45. package/examples/node_modules/@types/node/module.d.ts +0 -539
  46. package/examples/node_modules/@types/node/net.d.ts +0 -1012
  47. package/examples/node_modules/@types/node/os.d.ts +0 -506
  48. package/examples/node_modules/@types/node/package.json +0 -140
  49. package/examples/node_modules/@types/node/path.d.ts +0 -200
  50. package/examples/node_modules/@types/node/perf_hooks.d.ts +0 -961
  51. package/examples/node_modules/@types/node/process.d.ts +0 -1966
  52. package/examples/node_modules/@types/node/punycode.d.ts +0 -117
  53. package/examples/node_modules/@types/node/querystring.d.ts +0 -152
  54. package/examples/node_modules/@types/node/readline/promises.d.ts +0 -162
  55. package/examples/node_modules/@types/node/readline.d.ts +0 -589
  56. package/examples/node_modules/@types/node/repl.d.ts +0 -430
  57. package/examples/node_modules/@types/node/sea.d.ts +0 -153
  58. package/examples/node_modules/@types/node/stream/consumers.d.ts +0 -38
  59. package/examples/node_modules/@types/node/stream/promises.d.ts +0 -90
  60. package/examples/node_modules/@types/node/stream/web.d.ts +0 -533
  61. package/examples/node_modules/@types/node/stream.d.ts +0 -1675
  62. package/examples/node_modules/@types/node/string_decoder.d.ts +0 -67
  63. package/examples/node_modules/@types/node/test.d.ts +0 -1787
  64. package/examples/node_modules/@types/node/timers/promises.d.ts +0 -108
  65. package/examples/node_modules/@types/node/timers.d.ts +0 -286
  66. package/examples/node_modules/@types/node/tls.d.ts +0 -1259
  67. package/examples/node_modules/@types/node/trace_events.d.ts +0 -197
  68. package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  69. package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  70. package/examples/node_modules/@types/node/ts5.6/index.d.ts +0 -93
  71. package/examples/node_modules/@types/node/tty.d.ts +0 -208
  72. package/examples/node_modules/@types/node/url.d.ts +0 -964
  73. package/examples/node_modules/@types/node/util.d.ts +0 -2331
  74. package/examples/node_modules/@types/node/v8.d.ts +0 -809
  75. package/examples/node_modules/@types/node/vm.d.ts +0 -1001
  76. package/examples/node_modules/@types/node/wasi.d.ts +0 -181
  77. package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  78. package/examples/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  79. package/examples/node_modules/@types/node/web-globals/events.d.ts +0 -97
  80. package/examples/node_modules/@types/node/web-globals/fetch.d.ts +0 -46
  81. package/examples/node_modules/@types/node/worker_threads.d.ts +0 -715
  82. package/examples/node_modules/@types/node/zlib.d.ts +0 -540
  83. package/examples/node_modules/dotenv/config.d.ts +0 -1
  84. package/examples/node_modules/dotenv/config.js +0 -9
  85. package/examples/node_modules/dotenv/lib/cli-options.js +0 -17
  86. package/examples/node_modules/dotenv/lib/env-options.js +0 -28
  87. package/examples/node_modules/dotenv/lib/main.d.ts +0 -162
  88. package/examples/node_modules/dotenv/lib/main.js +0 -386
  89. package/examples/node_modules/dotenv/package.json +0 -62
  90. package/examples/node_modules/esbuild/install.js +0 -289
  91. package/examples/node_modules/esbuild/lib/main.d.ts +0 -716
  92. package/examples/node_modules/esbuild/lib/main.js +0 -2242
  93. package/examples/node_modules/esbuild/package.json +0 -49
  94. package/examples/node_modules/fsevents/fsevents.d.ts +0 -46
  95. package/examples/node_modules/fsevents/fsevents.js +0 -83
  96. package/examples/node_modules/fsevents/package.json +0 -62
  97. package/examples/node_modules/get-tsconfig/dist/index.mjs +0 -7
  98. package/examples/node_modules/get-tsconfig/package.json +0 -46
  99. package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +0 -1
  100. package/examples/node_modules/resolve-pkg-maps/package.json +0 -42
  101. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +0 -1
  102. package/examples/node_modules/tsx/dist/cjs/index.mjs +0 -1
  103. package/examples/node_modules/tsx/dist/cli.mjs +0 -55
  104. package/examples/node_modules/tsx/dist/client-BQVF1NaW.mjs +0 -1
  105. package/examples/node_modules/tsx/dist/esm/api/index.mjs +0 -1
  106. package/examples/node_modules/tsx/dist/esm/index.mjs +0 -2
  107. package/examples/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +0 -1
  108. package/examples/node_modules/tsx/dist/index-7AaEi15b.mjs +0 -14
  109. package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +0 -1
  110. package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +0 -3
  111. package/examples/node_modules/tsx/dist/loader.mjs +0 -1
  112. package/examples/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +0 -1
  113. package/examples/node_modules/tsx/dist/package-CeBgXWuR.mjs +0 -1
  114. package/examples/node_modules/tsx/dist/patch-repl.mjs +0 -1
  115. package/examples/node_modules/tsx/dist/preflight.mjs +0 -1
  116. package/examples/node_modules/tsx/dist/register-B7jrtLTO.mjs +0 -1
  117. package/examples/node_modules/tsx/dist/register-CFH5oNdT.mjs +0 -4
  118. package/examples/node_modules/tsx/dist/repl.mjs +0 -3
  119. package/examples/node_modules/tsx/dist/require-DQxpCAr4.mjs +0 -1
  120. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +0 -1
  121. package/examples/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +0 -1
  122. package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +0 -5
  123. package/examples/node_modules/tsx/package.json +0 -68
  124. package/examples/node_modules/undici-types/agent.d.ts +0 -31
  125. package/examples/node_modules/undici-types/api.d.ts +0 -43
  126. package/examples/node_modules/undici-types/balanced-pool.d.ts +0 -29
  127. package/examples/node_modules/undici-types/cache.d.ts +0 -36
  128. package/examples/node_modules/undici-types/client.d.ts +0 -108
  129. package/examples/node_modules/undici-types/connector.d.ts +0 -34
  130. package/examples/node_modules/undici-types/content-type.d.ts +0 -21
  131. package/examples/node_modules/undici-types/cookies.d.ts +0 -28
  132. package/examples/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  133. package/examples/node_modules/undici-types/dispatcher.d.ts +0 -256
  134. package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  135. package/examples/node_modules/undici-types/errors.d.ts +0 -149
  136. package/examples/node_modules/undici-types/eventsource.d.ts +0 -61
  137. package/examples/node_modules/undici-types/fetch.d.ts +0 -209
  138. package/examples/node_modules/undici-types/file.d.ts +0 -39
  139. package/examples/node_modules/undici-types/filereader.d.ts +0 -54
  140. package/examples/node_modules/undici-types/formdata.d.ts +0 -108
  141. package/examples/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  142. package/examples/node_modules/undici-types/global-origin.d.ts +0 -7
  143. package/examples/node_modules/undici-types/handlers.d.ts +0 -15
  144. package/examples/node_modules/undici-types/header.d.ts +0 -4
  145. package/examples/node_modules/undici-types/index.d.ts +0 -71
  146. package/examples/node_modules/undici-types/interceptors.d.ts +0 -17
  147. package/examples/node_modules/undici-types/mock-agent.d.ts +0 -50
  148. package/examples/node_modules/undici-types/mock-client.d.ts +0 -25
  149. package/examples/node_modules/undici-types/mock-errors.d.ts +0 -12
  150. package/examples/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  151. package/examples/node_modules/undici-types/mock-pool.d.ts +0 -25
  152. package/examples/node_modules/undici-types/package.json +0 -55
  153. package/examples/node_modules/undici-types/patch.d.ts +0 -33
  154. package/examples/node_modules/undici-types/pool-stats.d.ts +0 -19
  155. package/examples/node_modules/undici-types/pool.d.ts +0 -39
  156. package/examples/node_modules/undici-types/proxy-agent.d.ts +0 -28
  157. package/examples/node_modules/undici-types/readable.d.ts +0 -65
  158. package/examples/node_modules/undici-types/retry-agent.d.ts +0 -8
  159. package/examples/node_modules/undici-types/retry-handler.d.ts +0 -116
  160. package/examples/node_modules/undici-types/util.d.ts +0 -18
  161. package/examples/node_modules/undici-types/webidl.d.ts +0 -228
  162. package/examples/node_modules/undici-types/websocket.d.ts +0 -150
@@ -1,108 +0,0 @@
1
- /**
2
- * The `timers/promises` API provides an alternative set of timer functions
3
- * that return `Promise` objects. The API is accessible via
4
- * `require('node:timers/promises')`.
5
- *
6
- * ```js
7
- * import {
8
- * setTimeout,
9
- * setImmediate,
10
- * setInterval,
11
- * } from 'node:timers/promises';
12
- * ```
13
- * @since v15.0.0
14
- * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/timers/promises.js)
15
- */
16
- declare module "timers/promises" {
17
- import { TimerOptions } from "node:timers";
18
- /**
19
- * ```js
20
- * import {
21
- * setTimeout,
22
- * } from 'node:timers/promises';
23
- *
24
- * const res = await setTimeout(100, 'result');
25
- *
26
- * console.log(res); // Prints 'result'
27
- * ```
28
- * @since v15.0.0
29
- * @param delay The number of milliseconds to wait before fulfilling the
30
- * promise. **Default:** `1`.
31
- * @param value A value with which the promise is fulfilled.
32
- */
33
- function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
34
- /**
35
- * ```js
36
- * import {
37
- * setImmediate,
38
- * } from 'node:timers/promises';
39
- *
40
- * const res = await setImmediate('result');
41
- *
42
- * console.log(res); // Prints 'result'
43
- * ```
44
- * @since v15.0.0
45
- * @param value A value with which the promise is fulfilled.
46
- */
47
- function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
48
- /**
49
- * Returns an async iterator that generates values in an interval of `delay` ms.
50
- * If `ref` is `true`, you need to call `next()` of async iterator explicitly
51
- * or implicitly to keep the event loop alive.
52
- *
53
- * ```js
54
- * import {
55
- * setInterval,
56
- * } from 'node:timers/promises';
57
- *
58
- * const interval = 100;
59
- * for await (const startTime of setInterval(interval, Date.now())) {
60
- * const now = Date.now();
61
- * console.log(now);
62
- * if ((now - startTime) > 1000)
63
- * break;
64
- * }
65
- * console.log(Date.now());
66
- * ```
67
- * @since v15.9.0
68
- * @param delay The number of milliseconds to wait between iterations.
69
- * **Default:** `1`.
70
- * @param value A value with which the iterator returns.
71
- */
72
- function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator<T>;
73
- interface Scheduler {
74
- /**
75
- * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
76
- * being developed as a standard Web Platform API.
77
- *
78
- * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent
79
- * to calling `timersPromises.setTimeout(delay, undefined, options)` except that
80
- * the `ref` option is not supported.
81
- *
82
- * ```js
83
- * import { scheduler } from 'node:timers/promises';
84
- *
85
- * await scheduler.wait(1000); // Wait one second before continuing
86
- * ```
87
- * @since v17.3.0, v16.14.0
88
- * @experimental
89
- * @param delay The number of milliseconds to wait before resolving the
90
- * promise.
91
- */
92
- wait(delay: number, options?: { signal?: AbortSignal }): Promise<void>;
93
- /**
94
- * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
95
- * being developed as a standard Web Platform API.
96
- *
97
- * Calling `timersPromises.scheduler.yield()` is equivalent to calling
98
- * `timersPromises.setImmediate()` with no arguments.
99
- * @since v17.3.0, v16.14.0
100
- * @experimental
101
- */
102
- yield(): Promise<void>;
103
- }
104
- const scheduler: Scheduler;
105
- }
106
- declare module "node:timers/promises" {
107
- export * from "timers/promises";
108
- }
@@ -1,286 +0,0 @@
1
- /**
2
- * The `timer` module exposes a global API for scheduling functions to
3
- * be called at some future period of time. Because the timer functions are
4
- * globals, there is no need to import `node:timers` to use the API.
5
- *
6
- * The timer functions within Node.js implement a similar API as the timers API
7
- * provided by Web Browsers but use a different internal implementation that is
8
- * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
- * @see [source](https://github.com/nodejs/node/blob/v20.x/lib/timers.js)
10
- */
11
- declare module "timers" {
12
- import { Abortable } from "node:events";
13
- import * as promises from "node:timers/promises";
14
- export interface TimerOptions extends Abortable {
15
- /**
16
- * Set to `false` to indicate that the scheduled `Timeout`
17
- * should not require the Node.js event loop to remain active.
18
- * @default true
19
- */
20
- ref?: boolean | undefined;
21
- }
22
- global {
23
- namespace NodeJS {
24
- /**
25
- * This object is created internally and is returned from `setImmediate()`. It
26
- * can be passed to `clearImmediate()` in order to cancel the scheduled
27
- * actions.
28
- *
29
- * By default, when an immediate is scheduled, the Node.js event loop will continue
30
- * running as long as the immediate is active. The `Immediate` object returned by
31
- * `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
32
- * functions that can be used to control this default behavior.
33
- */
34
- interface Immediate extends RefCounted, Disposable {
35
- /**
36
- * If true, the `Immediate` object will keep the Node.js event loop active.
37
- * @since v11.0.0
38
- */
39
- hasRef(): boolean;
40
- /**
41
- * When called, requests that the Node.js event loop _not_ exit so long as the
42
- * `Immediate` is active. Calling `immediate.ref()` multiple times will have no
43
- * effect.
44
- *
45
- * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
46
- * to call `immediate.ref()` unless `immediate.unref()` had been called previously.
47
- * @since v9.7.0
48
- * @returns a reference to `immediate`
49
- */
50
- ref(): this;
51
- /**
52
- * When called, the active `Immediate` object will not require the Node.js event
53
- * loop to remain active. If there is no other activity keeping the event loop
54
- * running, the process may exit before the `Immediate` object's callback is
55
- * invoked. Calling `immediate.unref()` multiple times will have no effect.
56
- * @since v9.7.0
57
- * @returns a reference to `immediate`
58
- */
59
- unref(): this;
60
- /**
61
- * Cancels the immediate. This is similar to calling `clearImmediate()`.
62
- * @since v20.5.0, v18.18.0
63
- * @experimental
64
- */
65
- [Symbol.dispose](): void;
66
- _onImmediate(...args: any[]): void;
67
- }
68
- // Legacy interface used in Node.js v9 and prior
69
- /** @deprecated Use `NodeJS.Timeout` instead. */
70
- interface Timer extends RefCounted {
71
- hasRef(): boolean;
72
- refresh(): this;
73
- [Symbol.toPrimitive](): number;
74
- }
75
- /**
76
- * This object is created internally and is returned from `setTimeout()` and
77
- * `setInterval()`. It can be passed to either `clearTimeout()` or
78
- * `clearInterval()` in order to cancel the scheduled actions.
79
- *
80
- * By default, when a timer is scheduled using either `setTimeout()` or
81
- * `setInterval()`, the Node.js event loop will continue running as long as the
82
- * timer is active. Each of the `Timeout` objects returned by these functions
83
- * export both `timeout.ref()` and `timeout.unref()` functions that can be used to
84
- * control this default behavior.
85
- */
86
- interface Timeout extends RefCounted, Disposable, Timer {
87
- /**
88
- * Cancels the timeout.
89
- * @since v0.9.1
90
- * @legacy Use `clearTimeout()` instead.
91
- * @returns a reference to `timeout`
92
- */
93
- close(): this;
94
- /**
95
- * If true, the `Timeout` object will keep the Node.js event loop active.
96
- * @since v11.0.0
97
- */
98
- hasRef(): boolean;
99
- /**
100
- * When called, requests that the Node.js event loop _not_ exit so long as the
101
- * `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
102
- *
103
- * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
104
- * to call `timeout.ref()` unless `timeout.unref()` had been called previously.
105
- * @since v0.9.1
106
- * @returns a reference to `timeout`
107
- */
108
- ref(): this;
109
- /**
110
- * Sets the timer's start time to the current time, and reschedules the timer to
111
- * call its callback at the previously specified duration adjusted to the current
112
- * time. This is useful for refreshing a timer without allocating a new
113
- * JavaScript object.
114
- *
115
- * Using this on a timer that has already called its callback will reactivate the
116
- * timer.
117
- * @since v10.2.0
118
- * @returns a reference to `timeout`
119
- */
120
- refresh(): this;
121
- /**
122
- * When called, the active `Timeout` object will not require the Node.js event loop
123
- * to remain active. If there is no other activity keeping the event loop running,
124
- * the process may exit before the `Timeout` object's callback is invoked. Calling
125
- * `timeout.unref()` multiple times will have no effect.
126
- * @since v0.9.1
127
- * @returns a reference to `timeout`
128
- */
129
- unref(): this;
130
- /**
131
- * Coerce a `Timeout` to a primitive. The primitive can be used to
132
- * clear the `Timeout`. The primitive can only be used in the
133
- * same thread where the timeout was created. Therefore, to use it
134
- * across `worker_threads` it must first be passed to the correct
135
- * thread. This allows enhanced compatibility with browser
136
- * `setTimeout()` and `setInterval()` implementations.
137
- * @since v14.9.0, v12.19.0
138
- */
139
- [Symbol.toPrimitive](): number;
140
- /**
141
- * Cancels the timeout.
142
- * @since v20.5.0, v18.18.0
143
- * @experimental
144
- */
145
- [Symbol.dispose](): void;
146
- _onTimeout(...args: any[]): void;
147
- }
148
- }
149
- /**
150
- * Schedules the "immediate" execution of the `callback` after I/O events'
151
- * callbacks.
152
- *
153
- * When multiple calls to `setImmediate()` are made, the `callback` functions are
154
- * queued for execution in the order in which they are created. The entire callback
155
- * queue is processed every event loop iteration. If an immediate timer is queued
156
- * from inside an executing callback, that timer will not be triggered until the
157
- * next event loop iteration.
158
- *
159
- * If `callback` is not a function, a `TypeError` will be thrown.
160
- *
161
- * This method has a custom variant for promises that is available using
162
- * `timersPromises.setImmediate()`.
163
- * @since v0.9.1
164
- * @param callback The function to call at the end of this turn of
165
- * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
166
- * @param args Optional arguments to pass when the `callback` is called.
167
- * @returns for use with `clearImmediate()`
168
- */
169
- function setImmediate<TArgs extends any[]>(
170
- callback: (...args: TArgs) => void,
171
- ...args: TArgs
172
- ): NodeJS.Immediate;
173
- // Allow a single void-accepting argument to be optional in arguments lists.
174
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
175
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
176
- function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
177
- namespace setImmediate {
178
- import __promisify__ = promises.setImmediate;
179
- export { __promisify__ };
180
- }
181
- /**
182
- * Schedules repeated execution of `callback` every `delay` milliseconds.
183
- *
184
- * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be
185
- * set to `1`. Non-integer delays are truncated to an integer.
186
- *
187
- * If `callback` is not a function, a `TypeError` will be thrown.
188
- *
189
- * This method has a custom variant for promises that is available using
190
- * `timersPromises.setInterval()`.
191
- * @since v0.0.1
192
- * @param callback The function to call when the timer elapses.
193
- * @param delay The number of milliseconds to wait before calling the
194
- * `callback`. **Default:** `1`.
195
- * @param args Optional arguments to pass when the `callback` is called.
196
- * @returns for use with `clearInterval()`
197
- */
198
- function setInterval<TArgs extends any[]>(
199
- callback: (...args: TArgs) => void,
200
- delay?: number,
201
- ...args: TArgs
202
- ): NodeJS.Timeout;
203
- // Allow a single void-accepting argument to be optional in arguments lists.
204
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
205
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
206
- function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
207
- /**
208
- * Schedules execution of a one-time `callback` after `delay` milliseconds.
209
- *
210
- * The `callback` will likely not be invoked in precisely `delay` milliseconds.
211
- * Node.js makes no guarantees about the exact timing of when callbacks will fire,
212
- * nor of their ordering. The callback will be called as close as possible to the
213
- * time specified.
214
- *
215
- * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
216
- * will be set to `1`. Non-integer delays are truncated to an integer.
217
- *
218
- * If `callback` is not a function, a `TypeError` will be thrown.
219
- *
220
- * This method has a custom variant for promises that is available using
221
- * `timersPromises.setTimeout()`.
222
- * @since v0.0.1
223
- * @param callback The function to call when the timer elapses.
224
- * @param delay The number of milliseconds to wait before calling the
225
- * `callback`. **Default:** `1`.
226
- * @param args Optional arguments to pass when the `callback` is called.
227
- * @returns for use with `clearTimeout()`
228
- */
229
- function setTimeout<TArgs extends any[]>(
230
- callback: (...args: TArgs) => void,
231
- delay?: number,
232
- ...args: TArgs
233
- ): NodeJS.Timeout;
234
- // Allow a single void-accepting argument to be optional in arguments lists.
235
- // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
236
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
237
- function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
238
- namespace setTimeout {
239
- import __promisify__ = promises.setTimeout;
240
- export { __promisify__ };
241
- }
242
- /**
243
- * Cancels an `Immediate` object created by `setImmediate()`.
244
- * @since v0.9.1
245
- * @param immediate An `Immediate` object as returned by `setImmediate()`.
246
- */
247
- function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
248
- /**
249
- * Cancels a `Timeout` object created by `setInterval()`.
250
- * @since v0.0.1
251
- * @param timeout A `Timeout` object as returned by `setInterval()`
252
- * or the primitive of the `Timeout` object as a string or a number.
253
- */
254
- function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
255
- /**
256
- * Cancels a `Timeout` object created by `setTimeout()`.
257
- * @since v0.0.1
258
- * @param timeout A `Timeout` object as returned by `setTimeout()`
259
- * or the primitive of the `Timeout` object as a string or a number.
260
- */
261
- function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
262
- /**
263
- * The `queueMicrotask()` method queues a microtask to invoke `callback`. If
264
- * `callback` throws an exception, the `process` object `'uncaughtException'`
265
- * event will be emitted.
266
- *
267
- * The microtask queue is managed by V8 and may be used in a similar manner to
268
- * the `process.nextTick()` queue, which is managed by Node.js. The
269
- * `process.nextTick()` queue is always processed before the microtask queue
270
- * within each turn of the Node.js event loop.
271
- * @since v11.0.0
272
- * @param callback Function to be queued.
273
- */
274
- function queueMicrotask(callback: () => void): void;
275
- }
276
- import clearImmediate = globalThis.clearImmediate;
277
- import clearInterval = globalThis.clearInterval;
278
- import clearTimeout = globalThis.clearTimeout;
279
- import setImmediate = globalThis.setImmediate;
280
- import setInterval = globalThis.setInterval;
281
- import setTimeout = globalThis.setTimeout;
282
- export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
283
- }
284
- declare module "node:timers" {
285
- export * from "timers";
286
- }