/
enums.component.ts
53 lines (42 loc) · 1.12 KB
/
enums.component.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
import { Component, Input } from '@angular/core';
/**
* This component is used for testing the various forms of enum types
*/
@Component({
selector: 'app-enums',
templateUrl: './enums.component.html',
})
export class EnumsComponent {
/** Union Type of string literals */
@Input() unionType: 'Union A' | 'Union B' | 'Union C';
/** Union Type assigned as a Type Alias */
@Input() aliasedUnionType: TypeAlias;
/** Base Enum Type with no assigned values */
@Input() enumNumeric: EnumNumeric;
/** Enum with initial numeric value and auto-incrementing subsequent values */
@Input() enumNumericInitial: EnumNumericInitial;
/** Enum with string values */
@Input() enumStrings: EnumStringValues;
/** Type Aliased Enum Type */
@Input() enumAlias: EnumAlias;
}
/**
* Button Priority
*/
export enum EnumNumeric {
FIRST,
SECOND,
THIRD,
}
export enum EnumNumericInitial {
UNO = 1,
DOS,
TRES,
}
export enum EnumStringValues {
PRIMARY = 'PRIMARY',
SECONDARY = 'SECONDARY',
TERTIARY = 'TERTIARY',
}
export type EnumAlias = EnumNumeric;
type TypeAlias = 'Type Alias 1' | 'Type Alias 2' | 'Type Alias 3';