1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const abstract_1 = require("./abstract");
|
4 | class TypeOperatorType extends abstract_1.Type {
|
5 | constructor(target) {
|
6 | super();
|
7 | this.type = 'typeOperator';
|
8 | this.operator = 'keyof';
|
9 | this.target = target;
|
10 | }
|
11 | clone() {
|
12 | return new TypeOperatorType(this.target.clone());
|
13 | }
|
14 | equals(type) {
|
15 | if (!(type instanceof TypeOperatorType)) {
|
16 | return false;
|
17 | }
|
18 | return type.target.equals(this.target);
|
19 | }
|
20 | toObject() {
|
21 | const result = super.toObject();
|
22 | result.operator = this.operator;
|
23 | result.target = this.target.toObject();
|
24 | return result;
|
25 | }
|
26 | toString() {
|
27 | return `${this.operator} ${this.target.toString()}`;
|
28 | }
|
29 | }
|
30 | exports.TypeOperatorType = TypeOperatorType;
|
31 |
|
\ | No newline at end of file |