inferred-types 0.22.6 → 0.22.7
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/dist/index.d.ts
CHANGED
|
@@ -522,6 +522,14 @@ declare type DictPartialApplication<T extends Record<string, any>, I extends boo
|
|
|
522
522
|
* the original object `I` so long as the original value for the KV pair extends `V`.
|
|
523
523
|
*
|
|
524
524
|
* If `V` is not specified then it defaults to _any_ and therefore all KVs are preserved.
|
|
525
|
+
*
|
|
526
|
+
* ```ts
|
|
527
|
+
* type Obj = { foo: "hello", bar: 42, baz: () => "world" };
|
|
528
|
+
* // { foo: number, bar: number, baz: number };
|
|
529
|
+
* type AllNumbers = DictChangeValue<Obj, number>;
|
|
530
|
+
* // { foo: number }
|
|
531
|
+
* type StringToBool = DictChangeValue<Obj, boolean, string>
|
|
532
|
+
* ```
|
|
525
533
|
*/
|
|
526
534
|
declare type DictChangeValue<
|
|
527
535
|
/** the object who's value-type we're changing */
|
package/package.json
CHANGED
|
@@ -5,6 +5,14 @@ import { SimplifyObject } from "../SimplifyObject";
|
|
|
5
5
|
* the original object `I` so long as the original value for the KV pair extends `V`.
|
|
6
6
|
*
|
|
7
7
|
* If `V` is not specified then it defaults to _any_ and therefore all KVs are preserved.
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* type Obj = { foo: "hello", bar: 42, baz: () => "world" };
|
|
11
|
+
* // { foo: number, bar: number, baz: number };
|
|
12
|
+
* type AllNumbers = DictChangeValue<Obj, number>;
|
|
13
|
+
* // { foo: number }
|
|
14
|
+
* type StringToBool = DictChangeValue<Obj, boolean, string>
|
|
15
|
+
* ```
|
|
8
16
|
*/
|
|
9
17
|
export type DictChangeValue<
|
|
10
18
|
/** the object who's value-type we're changing */
|