@nubjs/types 0.6.0 → 0.7.0

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 (2) hide show
  1. package/index.d.ts +15 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -164,6 +164,21 @@ interface ImportMeta {
164
164
  };
165
165
  }
166
166
 
167
+ // ── Promise.allKeyed / Promise.allSettledKeyed (TC39 "await dictionary", Stage 3;
168
+ // runtime/polyfills.cjs) ──
169
+ // In no engine, in no @types/node, in no TypeScript lib. The mapped types mirror
170
+ // the proposal README's own signatures: the key set is preserved and each value is
171
+ // `Awaited`. Two runtime facts TypeScript cannot express — the result object has a
172
+ // null prototype, and its keys are the argument's own ENUMERABLE keys (so a
173
+ // non-enumerable or inherited property is absent at runtime while `keyof` still
174
+ // includes it). Neither affects the destructuring this API exists for.
175
+ interface PromiseConstructor {
176
+ allKeyed<T extends object>(promises: T): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;
177
+ allSettledKeyed<T extends object>(
178
+ promises: T,
179
+ ): Promise<{ -readonly [K in keyof T]: PromiseSettledResult<Awaited<T[K]>> }>;
180
+ }
181
+
167
182
  // ── Date.prototype.toTemporalInstant (runtime/preload-common.cjs installs it) ──
168
183
  // Nub assigns the polyfill's `toTemporalInstant` onto Date.prototype on the floor
169
184
  // (matching native Node, which ships it once Temporal is native).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nubjs/types",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript ambient declarations for code authored against the Nub runtime",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/nubjs/nub",