free-types-core 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/dist/Type.d.ts +1 -10
- package/dist/hkt.d.ts +11 -5
- package/package.json +1 -1
package/dist/Type.d.ts
CHANGED
|
@@ -10,19 +10,10 @@ interface CreateType<T extends {
|
|
|
10
10
|
type: unknown;
|
|
11
11
|
constraints: unknown[];
|
|
12
12
|
}> {
|
|
13
|
+
[k: number]: unknown;
|
|
13
14
|
type: T['type'];
|
|
14
15
|
constraints: T['constraints'];
|
|
15
16
|
arguments: unknown[];
|
|
16
|
-
0: unknown;
|
|
17
|
-
1: unknown;
|
|
18
|
-
2: unknown;
|
|
19
|
-
3: unknown;
|
|
20
|
-
4: unknown;
|
|
21
|
-
5: unknown;
|
|
22
|
-
6: unknown;
|
|
23
|
-
7: unknown;
|
|
24
|
-
8: unknown;
|
|
25
|
-
9: unknown;
|
|
26
17
|
}
|
|
27
18
|
declare type Slots<T> = T extends Precomputable ? PrecomputedSlots[T & Precomputable] : Tuple<T extends unknown[] ? T['length'] : T extends number ? T : number>;
|
|
28
19
|
declare type Constraints<Input, Slots> = number extends Input ? unknown[] : unknown[] extends Input ? unknown[] : Input extends unknown[] ? Input : Slots;
|
package/dist/hkt.d.ts
CHANGED
|
@@ -5,9 +5,15 @@ declare type HKT = {
|
|
|
5
5
|
HKT: [any, ...any[]];
|
|
6
6
|
};
|
|
7
7
|
/** Expect a free type with contravariant arguments */
|
|
8
|
-
declare type Contra<$T
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
declare type Contra<$T, $U extends Type> = _Contra<$T, $U>['type'];
|
|
9
|
+
interface _Contra<$T, $U extends Type> {
|
|
10
|
+
type: $U['constraints'] extends this['$T']['constraints'] ? this['$T']['type'] extends $U['type'] ? Type : Type<this['$T']['constraints'], $U['type']> : {
|
|
11
|
+
[K in 'Contravariance issue']: [
|
|
12
|
+
'the input',
|
|
13
|
+
$U['constraints'],
|
|
14
|
+
'is not assignable to',
|
|
15
|
+
this['$T']['constraints']
|
|
16
|
+
];
|
|
12
17
|
};
|
|
13
|
-
|
|
18
|
+
$T: $T extends Type ? $T : never;
|
|
19
|
+
}
|
package/package.json
CHANGED