diff --git a/src/task-1/app.ts b/src/task-1/app.ts new file mode 100644 index 0000000..f906be9 --- /dev/null +++ b/src/task-1/app.ts @@ -0,0 +1,3 @@ +Custom.user.upAgeByYear(); +console.log(Custom.user); +console.log(Custom.user.name, Custom.user.age); \ No newline at end of file diff --git a/src/task-1/index.html b/src/task-1/index.html index 2fde2d2..3dce073 100644 --- a/src/task-1/index.html +++ b/src/task-1/index.html @@ -32,6 +32,7 @@ })(Custom || (Custom = {})); Custom.user.upAgeByYear(); + - + \ No newline at end of file diff --git a/src/task-1/typing.dt.ts b/src/task-1/typing.dt.ts new file mode 100644 index 0000000..5ed0f9d --- /dev/null +++ b/src/task-1/typing.dt.ts @@ -0,0 +1,8 @@ +export declare namespace Custom { + interface User { + age: number; + name: string; + upAgeByYear(): void; + } + export let user: User; +} \ 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..e3a89d3 --- /dev/null +++ b/src/task-2/Example.ts @@ -0,0 +1,12 @@ +import {Setting} from "./Setting"; + +class Example { + public title: string; + public id: number; + private _setting: Setting; + + constructor(s: Setting) { + this._setting = s; + } +} +export { Example }; \ 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..cecbf81 --- /dev/null +++ b/src/task-2/Setting.ts @@ -0,0 +1,12 @@ +import { SettingValue } from "./SettingValue"; + +class Setting { + public key: string; + public value: SettingValue; + + constructor(k: string, ov: SettingValue) { + this.key = k; + this.value = ov; + } +} +export { Setting }; \ 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..9eabad1 --- /dev/null +++ b/src/task-2/SettingValue.ts @@ -0,0 +1,11 @@ +class SettingValue { + public property1: string; + public property2: string; + + constructor(p1: string, p2: string) { + this.property1 = p1; + this.property2 = p2; + } +} + +export { SettingValue }; \ 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..cfb0de7 --- /dev/null +++ b/src/task-2/index.html @@ -0,0 +1,10 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/src/task-2/index.ts b/src/task-2/index.ts index d5d9639..74c81f1 100644 --- a/src/task-2/index.ts +++ b/src/task-2/index.ts @@ -6,33 +6,12 @@ * все остальные файлы должны подгрузиться асинхронно по цепочке, используя requireJS. */ -class SettingValue { - public property1: string; - public property2: string; +import {SettingValue} from "./SettingValue"; +import {Setting} from "./Setting"; +import {Example} from "./Example"; - 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; - } -} +const example = new Example(new Setting('очень', new SettingValue('слож', 'но'))); +example.id = 100 +example.title = 'капец' +console.log(example.id) +console.log(example.title) \ No newline at end of file