diff --git a/src/task_1/app.ts b/src/task_1/app.ts new file mode 100644 index 0000000..3ab0837 --- /dev/null +++ b/src/task_1/app.ts @@ -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(); \ No newline at end of file diff --git a/src/task_1/typing.d.ts b/src/task_1/typing.d.ts new file mode 100644 index 0000000..e30efc6 --- /dev/null +++ b/src/task_1/typing.d.ts @@ -0,0 +1,7 @@ +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..04b3565 --- /dev/null +++ b/src/task_2/Example.ts @@ -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; + } +} \ 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..15a40b0 --- /dev/null +++ b/src/task_2/Setting.ts @@ -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; + } +} \ 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..9899c1d --- /dev/null +++ b/src/task_2/SettingValue.ts @@ -0,0 +1,9 @@ +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..5495715 --- /dev/null +++ b/src/task_2/index.html @@ -0,0 +1,15 @@ + + + +
+ +