-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathts.txt
134 lines (99 loc) · 2.96 KB
/
ts.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Write JSDoc documentations all classes, constructors, interfaces, types, functions(public/private/protected) and variables(public/private/protected) for code (Comments need to be written only for the code that I threw it off | Do not add any notes from yourself | Variays: let, const. Functional parts of the code: if, else, for, and so on, you do not need to comment | public/private/protected variables if they are inside the constructor, then they do not need to be commented):
CODE
Write your answer in the format:
|class/constructor/function/variable/type/interface Name|
Comment: ...
Example:
From code:
class Prototype {
public primitive: any;
public component: object;
public circularReference: ComponentWithBackReference;
public dots: [
Dot,
Dot,
Dot?,
Dot?,
Dot?,
Dot?,
Dot?,
Dot?,
Dot?,
Dot?,
];
constructor(){
}
public clone(): this {
const clone = Object.create(this);
clone.component = Object.create(this.component);
clone.circularReference = {
...this.circularReference,
prototype: { ...this },
};
return clone;
}
}
interface Shape {
getArea: () => number;
}
class Rectangle implements Shape {
public constructor(protected readonly width: number, protected readonly height: number) { }
public getArea(): number {
return this.widththis.height;
}
public toString(): string {
return `Rectangle[width=${this.width}, height=${this.height}]`;
}
}
Created comments:
|class Prototype|
Comment:
This class represents a prototype object that can be cloned.
@class
|public primitive|
Comment:
A public property that can hold any primitive value.
@type {any}
|public component|
Comment:
A public property that holds an object.
@type {object}
|public circularReference|
Comment:
A public property that holds a reference to another object of type ComponentWithBackReference.
@type {ComponentWithBackReference}
|public dots|
Comment:
A public property that holds the dots of the prototype.
@type {[Dot, Dot, Dot?, Dot?, Dot?, Dot?, Dot?, Dot?, Dot?, Dot?]}
|constructor|
Comment:
Creates a new Prototype instance.
@constructor
|public clone|
Comment:
Returns the clone of the object.
@returns {this}
|interface Shape|
Comment:
This interface represents a shape.
@interface
|class Rectangle|
Comment:
This class represents a rectangle shape and implements the Shape interface.
@implements {Shape}
@class
|constructor|
Comment:
Creates a new Rectangle instance with the given width and height.
@constructor
@param {number} width - The width of the rectangle.
@param {number} height - The height of the rectangle.
|public getArea|
Comment:
Calculates and returns the area of the rectangle.
@returns {number} - The area of the rectangle.
|public toString|
Comment:
Returns a string representation of the rectangle.
@returns {string} - The string representation of the rectangle.