-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.ts
35 lines (26 loc) · 825 Bytes
/
type.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
import { Empty } from "./class";
import { NotEmpty } from "./interface";
export type WindowStates = "open" | "closed" | "minimized";
export type LockStates = "locked" | "unlocked";
export type PositiveOddNumbersUnderTen = 1 | 3 | 5 | 7 | 9;
export type Name = string;
export type NameResolver = () => string;
export type NameOrResolver = Name | NameResolver;
export type StringArray = Array<string>;
export type NumberArray = Array<number>;
export type ObjectWithNameArray = Array<{ name: string }>;
export type Animal = {
name: string;
age: number;
};
export type Dog = Animal & {
breed: string;
};
export type Cat = Animal & {
color: string;
};
export type DogOrCat = Dog | Cat;
export type ToBeEmptyOrNotToBeEmpty<T> = Empty | NotEmpty<T>;
export type B = {
[key in 'a' | 'b' | 'c']: string;
}