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
15 changes: 15 additions & 0 deletions src/task_1/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var Custom;
(function (Custom) {
var User = /** @class */ (function () {
function User(a, n) {
this.age = a;
this.name = n;
}
User.prototype.upAgeByYear = function () {
this.age++;
};
return User;
}());
Custom.user = new User(18, "Михаил");
})(Custom || (Custom = {}));
Custom.user.upAgeByYear();
Copy link
Contributor

Choose a reason for hiding this comment

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

Тут должен был быть ts-код использования тайпингов а не копия из HTML

7 changes: 7 additions & 0 deletions src/task_1/typing.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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.

Это не будет работать. Смотри видео как делать тайпинги
https://www.youtube.com/watch?v=6ITG7PU2jlM&list=PL51FNaeWDci7CPQ-5BiqeFd6hfRWY_c6d&index=24

11 changes: 11 additions & 0 deletions src/task_2/Example.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**import { Setting } from './Setting'*/

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

constructor(s: Setting) {
this._setting = s;
}
}
11 changes: 11 additions & 0 deletions src/task_2/Setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**import { SettingValue } from '.SettingValue'*/

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 @@
class SettingValue {
public property1: string;
public property2: string;

constructor(p1: string, p2: string) {
this.property1 = p1;
this.property2 = p2;
}
}
15 changes: 15 additions & 0 deletions src/task_2/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="ru">

<head>
<meta charset="utf-8">
<title>Заголовок</title>
</head>

<body>
<script src="SettingValue.js">
Copy link
Contributor

Choose a reason for hiding this comment

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

нет подгрузки через requireJS


</script>
</body>

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

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

Expand Down Expand Up @@ -36,3 +37,5 @@ class Example {
this._setting = s;
}
}
*/

4 changes: 2 additions & 2 deletions src/task_3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HttpError extends Error {
}
}

function req(url: string): Promise<IUser> {
function req(url: string): Promise<IUser> {
return fetch(url)
.then((response: Response) => {
if (response.status == 200) {
Expand All @@ -28,7 +28,7 @@ function req(url: string): Promise<IUser> {
}

// Запрашивать логин, пока github не вернёт существующего пользователя.
function getGitHub() {
function getGitHub() {
let name = prompt("Введите логин на GitHub?", "");

return req(`https://api.github.com/users/${name}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

не сделано

Expand Down