@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.
- package/index.d.ts +15 -0
- 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).
|