/
test82.ts
42 lines (28 loc) 路 1.4 KB
/
test82.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
//NOTE: Test type only
import * as _ from "../lib/index.ts";
_.dom.__hack;
type A = _.SwapEvtType<_.Evt<number>, void>;
const a: _.VoidEvt = null as any as A;a;
type B = _.SwapEvtType<_.Evt<number>, string | number>;
const b: _.Evt<string | number> = null as any as B; b;
type C = _.SwapEvtType<_.StatefulEvt<number>, string | number>;
const c: _.StatefulEvt<string | number>= null as any as C; c;
type D = _.SwapEvtType<_.StatefulReadonlyEvt<number>, string | Date>;
const d: _.StatefulReadonlyEvt<string | Date>= null as any as D; d;
type E = _.SwapEvtType<_.NonPostableEvt<number>, string | Date>;
const e: _.NonPostableEvt<string | Date> = null as any as E;e;
type F = _.SwapEvtType<_.Evt<undefined | number>, string | Date>;
const f: _.Evt<string | Date>= null as any as F;f
type G = _.SwapEvtType<_.Evt<number | Date>, void>;
const g: _.VoidEvt = null as any as G; g;
type H = _.SwapEvtType<_.StatefulEvt<number>, void>;
const h: _.VoidEvt= null as any as H; h;
type I = _.SwapEvtType<_.StatefulReadonlyEvt<number>, void>;
const i: _.StatefulReadonlyEvt<void> = null as any as I; i;
type J = _.SwapEvtType<_.NonPostableEvt<number>, void>;
const j: _.NonPostableEvt<void>= null as any as J;j;
type K = _.SwapEvtType<_.Evt<undefined | number>, void>;
const k :_. VoidEvt = null as any as K; k;
type L = _.SwapEvtType<_.Evt<any>, void | number>;
const l :_. Evt<number | void> = null as any as L; l;
console.log("PASS");