-
Notifications
You must be signed in to change notification settings - Fork 10
Катюшкина #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Катюшкина #5
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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(); | ||
| 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; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это не будет работать. Смотри видео как делать тайпинги |
||
| 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; | ||
| } | ||
| } |
| 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; | ||
| } | ||
| } |
| 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; | ||
| } | ||
| } |
| 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"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. нет подгрузки через requireJS |
||
|
|
||
| </script> | ||
| </body> | ||
|
|
||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) { | ||
|
|
@@ -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}`) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. не сделано |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут должен был быть ts-код использования тайпингов а не копия из HTML