-
Notifications
You must be signed in to change notification settings - Fork 1
/
ObjectsTest.ts
63 lines (57 loc) · 1.79 KB
/
ObjectsTest.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
// tslint:disable:no-namespace
import { AssertTrue } from "./Assertions";
import {
FunctionPropertyNames,
PropertiesOfType,
PropertyNames,
PropertyNamesNotOfType,
PropertyNamesOfType,
PropertyTypes,
WithProperty,
} from "./Objects";
import { Eq } from "./Predicates";
export namespace PropertyNamesTest {
export let _test1: AssertTrue<
Eq<PropertyNames<{ name: string; onclick: () => void; member(): void }>, "name" | "onclick" | "member">
>;
}
export namespace PropertyTypesTest {
export let _test1: AssertTrue<
Eq<PropertyTypes<{ name: string; onclick: () => void; member(): void }>, string | (() => void)>
>;
}
export namespace PropertyNamesOfTypeTest {
export let _test1: AssertTrue<
Eq<
PropertyNamesOfType<{ ok: boolean; name: string; onclick: () => void; member(): void }, boolean | string>,
"name" | "ok"
>
>;
}
export namespace PropertyNamesNotOfTypeTest {
export let _test1: AssertTrue<
Eq<
PropertyNamesNotOfType<
{ ok: boolean; name: string; onclick: () => void; member(): void },
boolean | string
>,
"onclick" | "member"
>
>;
}
export namespace PropertiesOfTypeTest {
export let _test1: AssertTrue<
Eq<
PropertiesOfType<{ ok: boolean; name: string; onclick: () => void; member(): void }, boolean | string>,
{ ok: boolean; name: string }
>
>;
}
export namespace FunctionPropertyNamesTest {
export let _test1: AssertTrue<
Eq<FunctionPropertyNames<{ name: string; onclick: () => void; member(): void }>, "onclick" | "member">
>;
}
export namespace WithPropertyTest {
export type _test = AssertTrue<Eq<{ name: string }, WithProperty<"name", string>>>;
}