@alwatr/delay 1.0.6 → 1.0.8

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.8](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.7...@alwatr/delay@1.0.8) (2024-11-02)
7
+
8
+ ### Dependencies update
9
+
10
+ * update ([4434ba6](https://github.com/Alwatr/nanolib/commit/4434ba67c3f576bb1a0c307fbdb263c43cd9733a)) by @AliMD
11
+
12
+ ## [1.0.7](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.6...@alwatr/delay@1.0.7) (2024-10-25)
13
+
14
+ ### Dependencies update
15
+
16
+ * bump the development-dependencies group across 1 directory with 2 updates ([2dfda9e](https://github.com/Alwatr/nanolib/commit/2dfda9ec38a595f1fd961490d1a2fbf060f20a66)) by @dependabot[bot]
17
+ * bump the development-dependencies group with 8 updates ([16847ac](https://github.com/Alwatr/nanolib/commit/16847acba91da027c422e3910d0f2dcc1f084e93)) by @dependabot[bot]
18
+
6
19
  ## [1.0.6](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.5...@alwatr/delay@1.0.6) (2024-10-12)
7
20
 
8
21
  **Note:** Version bump only for package @alwatr/delay
@@ -11,19 +24,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
24
 
12
25
  ### Bug Fixes
13
26
 
14
- * use new `global-this` package & remove global type & prevent sidee-ffects ([092d448](https://github.com/Alwatr/nanolib/commit/092d44885738ed58215698917ae97c13958f7c7d)) by @mohammadhonarvar
27
+ - use new `global-this` package & remove global type & prevent sidee-ffects ([092d448](https://github.com/Alwatr/nanolib/commit/092d44885738ed58215698917ae97c13958f7c7d)) by @mohammadhonarvar
15
28
 
16
29
  ### Code Refactoring
17
30
 
18
- * **delay:** prevent side-effects ([f92eeed](https://github.com/Alwatr/nanolib/commit/f92eeed7d917f6eb3ca9a407fab0b1ea77adc1d4)) by @mohammadhonarvar
19
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
20
- * use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @mohammadhonarvar
31
+ - **delay:** prevent side-effects ([f92eeed](https://github.com/Alwatr/nanolib/commit/f92eeed7d917f6eb3ca9a407fab0b1ea77adc1d4)) by @mohammadhonarvar
32
+ - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
33
+ - use new `global-this` package ([42510b9](https://github.com/Alwatr/nanolib/commit/42510b9ae0e385206a902db093d188949f1cb84e)) by @mohammadhonarvar
21
34
 
22
35
  ## [1.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.3...@alwatr/delay@1.0.4) (2024-10-11)
23
36
 
24
37
  ### Miscellaneous Chores
25
38
 
26
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @AliMD
39
+ - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @AliMD
27
40
 
28
41
  ## [1.0.3](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.2...@alwatr/delay@1.0.3) (2024-10-11)
29
42
 
@@ -33,7 +46,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
33
46
 
34
47
  ### Dependencies update
35
48
 
36
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
49
+ - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
37
50
 
38
51
  ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.0.0...@alwatr/delay@1.0.1) (2024-10-08)
39
52
 
@@ -43,19 +56,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
43
56
 
44
57
  ### Features
45
58
 
46
- * use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
59
+ - use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
47
60
 
48
61
  ### Code Refactoring
49
62
 
50
- * **delay:** update delay package to use @alwatr/parse-duration for duration delays ([cca1be2](https://github.com/Alwatr/nanolib/commit/cca1be2dcfeec6dce388562ef867b81af1823b62)) by @AliMD
51
- * **delay:** update untilIdle function to accept Duration instead of DurationString ([b3a5c32](https://github.com/Alwatr/nanolib/commit/b3a5c322a1b59833693149da644c7d2eddd6a374)) by @AliMD
52
- * update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @AliMD
53
- * use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @AliMD
54
- * **wait:** rename package to delay ([cf8c45c](https://github.com/Alwatr/nanolib/commit/cf8c45cf3f5b61fdd4b1b1c7f744c4eb3e230016)) by @AliMD
63
+ - **delay:** update delay package to use @alwatr/parse-duration for duration delays ([cca1be2](https://github.com/Alwatr/nanolib/commit/cca1be2dcfeec6dce388562ef867b81af1823b62)) by @AliMD
64
+ - **delay:** update untilIdle function to accept Duration instead of DurationString ([b3a5c32](https://github.com/Alwatr/nanolib/commit/b3a5c322a1b59833693149da644c7d2eddd6a374)) by @AliMD
65
+ - update Dictionary type definitions ([c94cbc4](https://github.com/Alwatr/nanolib/commit/c94cbc4523864e2cc47828ccf5508b68945ac2b8)) by @AliMD
66
+ - use new type-helper global types and remove all import types ([08b5d08](https://github.com/Alwatr/nanolib/commit/08b5d08c03c7c315382337239de0426462f384b8)) by @AliMD
67
+ - **wait:** rename package to delay ([cf8c45c](https://github.com/Alwatr/nanolib/commit/cf8c45cf3f5b61fdd4b1b1c7f744c4eb3e230016)) by @AliMD
55
68
 
56
69
  ### Miscellaneous Chores
57
70
 
58
- * fix versions ([497a6d8](https://github.com/Alwatr/nanolib/commit/497a6d81ae5989e566e96d498fc5f1b6c80193ae)) by @AliMD
71
+ - fix versions ([497a6d8](https://github.com/Alwatr/nanolib/commit/497a6d81ae5989e566e96d498fc5f1b6c80193ae)) by @AliMD
59
72
 
60
73
  ## [1.1.16](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.15...@alwatr/delay@1.1.16) (2024-09-21)
61
74
 
@@ -65,32 +78,32 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
65
78
 
66
79
  ### Dependencies update
67
80
 
68
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
69
- * update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
81
+ - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
82
+ - update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
70
83
 
71
84
  ## [1.1.14](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.13...@alwatr/delay@1.1.14) (2024-08-31)
72
85
 
73
86
  ### Miscellaneous Chores
74
87
 
75
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
88
+ - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
76
89
 
77
90
  ## [1.1.13](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.12...@alwatr/delay@1.1.13) (2024-08-31)
78
91
 
79
92
  ### Dependencies update
80
93
 
81
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @AliMD
94
+ - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @AliMD
82
95
 
83
96
  ## [1.1.12](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.11...@alwatr/delay@1.1.12) (2024-07-04)
84
97
 
85
98
  ### Dependencies update
86
99
 
87
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
100
+ - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
88
101
 
89
102
  ## [1.1.11](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.10...@alwatr/delay@1.1.11) (2024-05-12)
90
103
 
91
104
  ### Dependencies update
92
105
 
93
- * upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @AliMD
106
+ - upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @AliMD
94
107
 
95
108
  ## [1.1.10](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.9...@alwatr/delay@1.1.10) (2024-04-25)
96
109
 
@@ -104,11 +117,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
104
117
 
105
118
  ### Bug Fixes
106
119
 
107
- * exported types by add .js extensions to all imports ([fc3d83e](https://github.com/Alwatr/nanolib/commit/fc3d83e8f375da97ba276314b2e6966aa82c9b3f)) by @AliMD
120
+ - exported types by add .js extensions to all imports ([fc3d83e](https://github.com/Alwatr/nanolib/commit/fc3d83e8f375da97ba276314b2e6966aa82c9b3f)) by @AliMD
108
121
 
109
122
  ### Miscellaneous Chores
110
123
 
111
- * **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @AliMD
124
+ - **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @AliMD
112
125
 
113
126
  ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/delay@1.1.6...@alwatr/delay@1.1.7) (2024-01-24)
114
127
 
package/README.md CHANGED
@@ -16,77 +16,84 @@ yarn add @alwatr/delay
16
16
 
17
17
  Each function within `@alwatr/delay` returns a Promise that resolves when the specified waiting condition is met. Here's a breakdown of the available functions:
18
18
 
19
- * **waitForTimeout(duration: number): Promise<void>**
20
- * Waits for a specified duration (in milliseconds) before resolving.
21
- * Example:
19
+ - **waitForTimeout(duration: number): Promise<void>**
20
+
21
+ - Waits for a specified duration (in milliseconds) before resolving.
22
+ - Example:
22
23
 
23
24
  ```typescript
24
- import { waitForTimeout } from '@alwatr/delay';
25
+ import {waitForTimeout} from '@alwatr/delay';
25
26
 
26
27
  await waitForTimeout(1000); // Waits for 1 second
27
28
  ```
28
29
 
29
- * **waitForAnimationFrame(): Promise<DOMHighResTimeStamp>**
30
- * Pauses execution until the next animation frame is scheduled, resolving with the current timestamp.
31
- * Useful for synchronizing UI updates with browser rendering.
32
- * Example:
30
+ - **waitForAnimationFrame(): Promise<DOMHighResTimeStamp>**
31
+
32
+ - Pauses execution until the next animation frame is scheduled, resolving with the current timestamp.
33
+ - Useful for synchronizing UI updates with browser rendering.
34
+ - Example:
33
35
 
34
36
  ```typescript
35
- import { waitForAnimationFrame } from '@alwatr/delay';
37
+ import {waitForAnimationFrame} from '@alwatr/delay';
36
38
 
37
39
  await waitForAnimationFrame(); // Waits for next animation frame
38
40
  ```
39
41
 
40
- * **waitForIdle(timeout?: number): Promise<IdleDeadline>**
41
- * Waits for the next idle period (when the browser is not busy), resolving with an `IdleDeadline` object.
42
- * Optionally accepts a timeout value (in milliseconds) for maximum waiting time.
43
- * Ideal for executing tasks that don't impact user experience.
44
- * Example:
42
+ - **waitForIdle(timeout?: number): Promise<IdleDeadline>**
43
+
44
+ - Waits for the next idle period (when the browser is not busy), resolving with an `IdleDeadline` object.
45
+ - Optionally accepts a timeout value (in milliseconds) for maximum waiting time.
46
+ - Ideal for executing tasks that don't impact user experience.
47
+ - Example:
45
48
 
46
49
  ```typescript
47
- import { waitForIdle } from '@alwatr/delay';
50
+ import {waitForIdle} from '@alwatr/delay';
48
51
 
49
52
  await waitForIdle(); // Waits for next idle period
50
53
  ```
51
54
 
52
- * **waitForDomEvent<T extends keyof HTMLElementEventMap>(element: HTMLElement, eventName: T): Promise<HTMLElementEventMap[T]>**
53
- * Pauses execution until a specific DOM event is triggered on a provided element, resolving with the event object.
54
- * Example:
55
+ - **waitForDomEvent<T extends keyof HTMLElementEventMap>(element: HTMLElement, eventName: T): Promise<HTMLElementEventMap[T]>**
56
+
57
+ - Pauses execution until a specific DOM event is triggered on a provided element, resolving with the event object.
58
+ - Example:
55
59
 
56
60
  ```typescript
57
- import { waitForDomEvent } from '@alwatr/delay';
61
+ import {waitForDomEvent} from '@alwatr/delay';
58
62
 
59
63
  const button = document.getElementById('myButton');
60
64
  await waitForDomEvent(button, 'click'); // Waits for click event on button
61
65
  ```
62
66
 
63
- * **waitForEvent(target: HasAddEventListener, eventName: string): Promise<Event>**
64
- * More generic version of `waitForDomEvent`, allowing waiting for any event on any object with an `addEventListener` method.
65
- * Example:
67
+ - **waitForEvent(target: HasAddEventListener, eventName: string): Promise<Event>**
68
+
69
+ - More generic version of `waitForDomEvent`, allowing waiting for any event on any object with an `addEventListener` method.
70
+ - Example:
66
71
 
67
72
  ```typescript
68
- import { waitForEvent } from '@alwatr/delay';
73
+ import {waitForEvent} from '@alwatr/delay';
69
74
 
70
75
  const server = http.createServer();
71
76
  await waitForEvent(server, 'request'); // Waits for request event on server
72
77
  ```
73
78
 
74
- * **waitForImmediate(): Promise<void>**
75
- * Executes the next task in the microtask queue immediately after the current task finishes.
76
- * Example:
79
+ - **waitForImmediate(): Promise<void>**
80
+
81
+ - Executes the next task in the microtask queue immediately after the current task finishes.
82
+ - Example:
77
83
 
78
84
  ```typescript
79
- import { waitForImmediate } from '@alwatr/delay';
85
+ import {waitForImmediate} from '@alwatr/delay';
80
86
 
81
87
  await waitForImmediate(); // Executes next microtask
82
88
  ```
83
89
 
84
- * **waitForMicrotask(): Promise<void>**
85
- * Similar to `waitForImmediate`, but waits specifically for the next microtask queue.
86
- * Example:
90
+ - **waitForMicrotask(): Promise<void>**
91
+
92
+ - Similar to `waitForImmediate`, but waits specifically for the next microtask queue.
93
+ - Example:
87
94
 
88
95
  ```typescript
89
- import { waitForMicrotask } from '@alwatr/delay';
96
+ import {waitForMicrotask} from '@alwatr/delay';
90
97
 
91
98
  await waitForMicrotask(); // Waits for next microtask queue
92
99
  ```
package/dist/main.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /* @alwatr/delay v1.0.6 */
1
+ /* @alwatr/delay v1.0.8 */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -36,7 +36,7 @@ var requestIdleCallbackFallback = (callback, options) => setTimeout(callback, op
36
36
  var requestIdleCallback = /* @__PURE__ */ (() => win.requestIdleCallback || win.webkitRequestIdleCallback || win.mozRequestIdleCallback || requestIdleCallbackFallback)();
37
37
 
38
38
  // src/main.ts
39
- __dev_mode__: import_package_tracer.packageTracer.add("@alwatr/delay", "1.0.6");
39
+ __dev_mode__: import_package_tracer.packageTracer.add("@alwatr/delay", "1.0.8");
40
40
  var delay = {
41
41
  /**
42
42
  * Delays execution for a specified duration (in milliseconds).
package/dist/main.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /* @alwatr/delay v1.0.6 */
1
+ /* @alwatr/delay v1.0.8 */
2
2
 
3
3
  // src/main.ts
4
4
  import { packageTracer } from "@alwatr/package-tracer";
@@ -13,7 +13,7 @@ var requestIdleCallbackFallback = (callback, options) => setTimeout(callback, op
13
13
  var requestIdleCallback = /* @__PURE__ */ (() => win.requestIdleCallback || win.webkitRequestIdleCallback || win.mozRequestIdleCallback || requestIdleCallbackFallback)();
14
14
 
15
15
  // src/main.ts
16
- __dev_mode__: packageTracer.add("@alwatr/delay", "1.0.6");
16
+ __dev_mode__: packageTracer.add("@alwatr/delay", "1.0.8");
17
17
  var delay = {
18
18
  /**
19
19
  * Delays execution for a specified duration (in milliseconds).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/delay",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Comprehensive toolkit for managing asynchronous operations.",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "keywords": [
@@ -67,17 +67,17 @@
67
67
  "clean": "rm -rfv dist *.tsbuildinfo"
68
68
  },
69
69
  "dependencies": {
70
- "@alwatr/global-this": "^1.0.1",
71
- "@alwatr/package-tracer": "^1.0.6",
72
- "@alwatr/parse-duration": "^1.1.6"
70
+ "@alwatr/global-this": "^1.0.3",
71
+ "@alwatr/package-tracer": "^1.0.8",
72
+ "@alwatr/parse-duration": "^1.1.8"
73
73
  },
74
74
  "devDependencies": {
75
- "@alwatr/nano-build": "^2.0.2",
75
+ "@alwatr/nano-build": "^2.0.4",
76
76
  "@alwatr/prettier-config": "^1.0.6",
77
- "@alwatr/tsconfig-base": "^1.3.2",
78
- "@alwatr/type-helper": "^2.0.2",
79
- "@types/node": "^22.7.5",
77
+ "@alwatr/tsconfig-base": "^1.3.3",
78
+ "@alwatr/type-helper": "^2.0.3",
79
+ "@types/node": "^22.8.6",
80
80
  "typescript": "^5.6.3"
81
81
  },
82
- "gitHead": "15d12342d2e69fbb6129675cce620132c5bd0bfc"
82
+ "gitHead": "5aecc962a161034aa9213dcc5fb3c1cece9eaca2"
83
83
  }