From 43ae223a4ecd035a25e441a6f09f7dc39c5113bf Mon Sep 17 00:00:00 2001 From: evgeniy Date: Mon, 26 Apr 2021 22:32:22 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D1=81=D0=BA=D0=B8=D0=B9=20=D0=95=D0=B2=D0=B3=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/task_1/app.ts | 16 ++++++++++++++++ src/task_1/index.html | 4 ++-- src/task_1/typing.d.ts | 6 ++++++ src/task_2/Example.ts | 9 +++++++++ src/task_2/Setting.ts | 9 +++++++++ src/task_2/SettingValue.ts | 9 +++++++++ src/task_2/index.html | 12 ++++++++++++ src/task_2/index.ts | 30 ------------------------------ 8 files changed, 63 insertions(+), 32 deletions(-) create mode 100644 src/task_1/app.ts create mode 100644 src/task_1/typing.d.ts create mode 100644 src/task_2/Example.ts create mode 100644 src/task_2/Setting.ts create mode 100644 src/task_2/SettingValue.ts create mode 100644 src/task_2/index.html diff --git a/src/task_1/app.ts b/src/task_1/app.ts new file mode 100644 index 0000000..cdebd91 --- /dev/null +++ b/src/task_1/app.ts @@ -0,0 +1,16 @@ +/// +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(); \ No newline at end of file diff --git a/src/task_1/index.html b/src/task_1/index.html index f9c6cc1..1e09c1c 100644 --- a/src/task_1/index.html +++ b/src/task_1/index.html @@ -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++; diff --git a/src/task_1/typing.d.ts b/src/task_1/typing.d.ts new file mode 100644 index 0000000..3492850 --- /dev/null +++ b/src/task_1/typing.d.ts @@ -0,0 +1,6 @@ +declare class User { + public a: number; + public n: string; + constructor(a: number, n: string); + public upAgeByYear():void; +} \ No newline at end of file diff --git a/src/task_2/Example.ts b/src/task_2/Example.ts new file mode 100644 index 0000000..ebd4169 --- /dev/null +++ b/src/task_2/Example.ts @@ -0,0 +1,9 @@ +export class Example { + public title: string; + public id: number; + private _setting: Setting; + + constructor(s: Setting) { + this._setting = s; + } +} \ No newline at end of file diff --git a/src/task_2/Setting.ts b/src/task_2/Setting.ts new file mode 100644 index 0000000..bfc2b98 --- /dev/null +++ b/src/task_2/Setting.ts @@ -0,0 +1,9 @@ +export class Setting { + public key: string; + public value: SettingValue; + + constructor(k: string, ov: SettingValue) { + this.key = k; + this.value = ov; + } +} \ No newline at end of file diff --git a/src/task_2/SettingValue.ts b/src/task_2/SettingValue.ts new file mode 100644 index 0000000..5f90b42 --- /dev/null +++ b/src/task_2/SettingValue.ts @@ -0,0 +1,9 @@ +export class SettingValue { + public property1: string; + public property2: string; + + constructor(p1: string, p2: string) { + this.property1 = p1; + this.property2 = p2; + } +} \ No newline at end of file diff --git a/src/task_2/index.html b/src/task_2/index.html new file mode 100644 index 0000000..e51222d --- /dev/null +++ b/src/task_2/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git a/src/task_2/index.ts b/src/task_2/index.ts index a2fa801..492e21c 100644 --- a/src/task_2/index.ts +++ b/src/task_2/index.ts @@ -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; - } -}