/
test81.ts
104 lines (64 loc) 路 2.1 KB
/
test81.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//NOTE: Type only
import * as _ from "../lib/index.ts";
_.dom.__hack;
{
type T = void; type Source = _.VoidEvt;
type A = _.ToNonPostableEvt<Source>;
const x: _.NonPostableEvt<T> = null as any as A;x;
type B = _.ToPostableEvt<A>
const y: Source = null as any as B;y;
}
{
type T = undefined; type Source = _.Evt<T>;
type A = _.ToNonPostableEvt<Source>;
const x: _.NonPostableEvt<T> = null as any as A;x;
type B = _.ToPostableEvt<A>
const y: B = null as any as Source; y;
}
{
type T = undefined | number; type Source = _.Evt<T>;
type A = _.ToNonPostableEvt<Source>;
const x: _.NonPostableEvt<T> = null as any as A;x;
type B = _.ToPostableEvt<A>
const y: B = null as any as Source; y;
}
{
type T = undefined; type Source = _.StatefulEvt<T>;
type A = _.ToNonPostableEvt<Source>;
const x: _.StatefulReadonlyEvt<T> = null as any as A;x;
type B = _.ToPostableEvt<A>
const y: B = null as any as Source; y;
}
{
type T = undefined | number; type Source = _.StatefulEvt<T>;
type A = _.ToNonPostableEvt<Source>;
const x: _.StatefulReadonlyEvt<T> = null as any as A;x;
type B = _.ToPostableEvt<A>
const y: B = null as any as Source; y;
}
{
type Source = {
evtText: _.Evt<string | number>;
evtIsConnected: _.StatefulReadonlyEvt<boolean | number>;
evtTime: _.NonPostableEvt<number | Date>;
evtTime2: _.StatefulReadonlyEvt<number | Date>;
p: number;
};
type A = _.ToNonPostableEvt<Source>;
const x: {
evtText: _.NonPostableEvt<string | number>;
evtIsConnected: _.StatefulReadonlyEvt<number | boolean>;
evtTime: _.NonPostableEvt<number | Date>;
evtTime2: _.StatefulReadonlyEvt<number | Date>;
p: number;
}= null as any as A; x;
type B= _.ToPostableEvt<A>;
const y: {
evtText: _.Evt<string | number>;
evtIsConnected: _.StatefulEvt<number | boolean>;
evtTime: _.Evt<number | Date>;
evtTime2: _.StatefulEvt<number | Date>;
p: number;
}= null as any as B; y;
}
console.log("PASS");