waiit 3.0.2 → 4.0.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.
package/README.md CHANGED
@@ -134,7 +134,9 @@ waiit 3000 && echo "3 seconds passed"
134
134
  | `app.js` | ESM module (`import wait from 'waiit'`) |
135
135
  | `app.cjs` | CommonJS module (`require('waiit')`) |
136
136
  | `app.global.js` | UMD for browsers (`<script>` tag → `window.wait`) |
137
- | `app.d.ts` | TypeScript type definitions |
137
+ | `app.d.ts` | TypeScript type definitions (ESM) |
138
+ | `app.cjs.d.ts` | TypeScript type definitions (CommonJS) |
139
+ | `app.global.d.ts` | TypeScript type definitions (Global/UMD) |
138
140
  | `app.cli.js` | CLI binary (`npx waiit 1000`) |
139
141
 
140
142
 
package/app.cjs.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Promise-based delay utility. Tiny, typed, zero dependencies.
3
+ * @param ms Delay in ms (default: 0)
4
+ * @returns Promise that resolves after the specified delay
5
+ * @example wait(2000); // Wait for 2 seconds
6
+ */
7
+ declare function wait(ms?: number): Promise<void>;
8
+ export = wait;
package/app.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * @example wait(2000); // Wait for 2 seconds
6
6
  */
7
7
  declare function wait(ms?: number): Promise<void>;
8
- export = wait;
8
+ export { wait as default };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Promise-based delay utility. Tiny, typed, zero dependencies.
3
+ * @param ms Delay in ms (default: 0)
4
+ * @returns Promise that resolves after the specified delay
5
+ * @example wait(2000); // Wait for 2 seconds
6
+ */
7
+ declare function wait(ms?: number): Promise<void>;
8
+ declare global {
9
+ const wait: typeof wait;
10
+ }
11
+ export = wait;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waiit",
3
- "version": "3.0.2",
3
+ "version": "4.0.1",
4
4
  "description": "Promise-based delay utility. Tiny, typed, zero dependencies.",
5
5
  "main": "app.cjs",
6
6
  "module": "app.js",
@@ -10,9 +10,18 @@
10
10
  "bin": "app.cli.js",
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./app.d.ts",
14
- "import": "./app.js",
15
- "require": "./app.cjs"
13
+ "import": {
14
+ "types": "./app.d.ts",
15
+ "default": "./app.js"
16
+ },
17
+ "require": {
18
+ "types": "./app.cjs.d.ts",
19
+ "default": "./app.cjs"
20
+ },
21
+ "script": {
22
+ "types": "./app.global.d.ts",
23
+ "default": "./app.global.js"
24
+ }
16
25
  }
17
26
  },
18
27
  "sideEffects": false,
@@ -39,12 +48,14 @@
39
48
  "license": "MIT",
40
49
  "files": [
41
50
  "app.js",
51
+ "app.d.ts",
42
52
  "app.cjs",
53
+ "app.cjs.d.ts",
43
54
  "app.global.js",
44
- "app.d.ts",
55
+ "app.global.d.ts",
45
56
  "app.cli.js"
46
57
  ],
47
- "packageManager": "bun@1.3.6",
58
+ "packageManager": "bun@1.3.8",
48
59
  "engines": {
49
60
  "node": ">=14"
50
61
  }