Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/task_1/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="typing.d.ts" />
var Custom;
(function (Custom) {
var User = /** @class */ (function () {
function User(a, n) {
this.age = a; // number
this.name = n; // string
}
User.prototype.upAgeByYear = function () {
this.age++;
};
return User;
}());
Custom.user = new User(18, "Михаил");
})(Custom || (Custom = {}));
Custom.user.upAgeByYear();
4 changes: 2 additions & 2 deletions src/task_1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
(function (Custom) {
var User = /** @class */ (function () {
function User(a, n) {
this.age = a;
this.name = n;
this.age = a; // number
this.name = n; // string
}
User.prototype.upAgeByYear = function () {
this.age++;
Expand Down
6 changes: 6 additions & 0 deletions src/task_1/typing.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare class User {
public a: number;
public n: string;
constructor(a: number, n: string);
public upAgeByYear():void;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 changes: 9 additions & 0 deletions src/task_2/Example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Example {
public title: string;
public id: number;
private _setting: Setting;

constructor(s: Setting) {
this._setting = s;
}
}
9 changes: 9 additions & 0 deletions src/task_2/Setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Setting {
public key: string;
public value: SettingValue;

constructor(k: string, ov: SettingValue) {
this.key = k;
this.value = ov;
}
}
9 changes: 9 additions & 0 deletions src/task_2/SettingValue.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class SettingValue {
public property1: string;
public property2: string;

constructor(p1: string, p2: string) {
this.property1 = p1;
this.property2 = p2;
}
}
12 changes: 12 additions & 0 deletions src/task_2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script> src="SettingValue.js" </script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</body>
</html>
30 changes: 0 additions & 30 deletions src/task_2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,3 @@
* все остальные файлы должны подгрузиться асинхронно по цепочке, используя requireJS.
*/

class SettingValue {
public property1: string;
public property2: string;

constructor(p1: string, p2: string) {
this.property1 = p1;
this.property2 = p2;
}
}

class Setting {
public key: string;
public value: SettingValue;

constructor(k: string, ov: SettingValue) {
this.key = k;
this.value = ov;
}
}


class Example {
public title: string;
public id: number;
private _setting: Setting;

constructor(s: Setting) {
this._setting = s;
}
}